摘要: 阅读全文
posted @ 2020-05-08 23:46 北冥雪 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Redux Single Data Source All states is stored in an Object Tree, and the Object Tree is stored in only one store Easy to maintain, track and modify St 阅读全文
posted @ 2020-12-02 17:04 北冥雪 阅读(108) 评论(0) 推荐(0) 编辑
摘要: React-CSS Inline Style import React, { PureComponent } from "react"; export default class App extends PureComponent { constructor(porps) { super(); th 阅读全文
posted @ 2020-12-02 17:01 北冥雪 阅读(443) 评论(0) 推荐(0) 编辑
摘要: Higher-Order Components (HOC) HOC is a function with arguments as component and return value as new function // index.js ReactDOM.render(<App name="Sm 阅读全文
posted @ 2020-12-02 17:00 北冥雪 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Controlled & Uncontrolled Components Data is handle by a React Component ? Controlled : Uncontrolled Controlled Components: The values in the componen 阅读全文
posted @ 2020-12-02 16:59 北冥雪 阅读(64) 评论(0) 推荐(0) 编辑
摘要: Ref import React, { PureComponent, createRef, forwardRef } from "react"; // Can't use ref in function components, it doesn't have instance // Use the 阅读全文
posted @ 2020-12-02 16:57 北冥雪 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Components Communication Parent and Child Component Class Component import React, { Component } from "react"; class ChildCpn extends Component { rende 阅读全文
posted @ 2020-11-26 17:48 北冥雪 阅读(100) 评论(0) 推荐(0) 编辑
摘要: React Lifecycles^lifecycles getDerivedStateFromProps: Keeping the props always is the same as New props shouldComponentUpdate: We can control the comp 阅读全文
posted @ 2020-11-26 17:44 北冥雪 阅读(99) 评论(0) 推荐(0) 编辑
摘要: ReactCompositeEvent React is not just design for browsers[^reactCompositeEvent] 阅读全文
posted @ 2020-11-26 17:42 北冥雪 阅读(501) 评论(0) 推荐(0) 编辑
摘要: setState[^setState] Asynchronous: In the Liefcycles and the CompositeEvent of React [^reactCompositeEvent]:composite event import React, { Component } 阅读全文
posted @ 2020-11-26 17:41 北冥雪 阅读(75) 评论(0) 推荐(0) 编辑
摘要: propTypes & defaultProps import React, { Component } from "react"; import Proptypes from "prop-types"; // Function function ChildCpn(props) { const { 阅读全文
posted @ 2020-11-26 17:39 北冥雪 阅读(103) 评论(0) 推荐(0) 编辑