-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Part.1 React新的前端思维方式
略(Hello Demo)
Part.2 设计高质量的React组件
- Prop定义外部接口、State定义内部状态
- Prop+State 作为 Render的Data输入决定视图 UI = render(data)
- React组件生命周期
- Mount
- constructor
- getInitialState
- getDefaultProps
- componentWillMount
- render
- componentDidMount
- Update
- componentWillReceiveProps
- shouldComponentUpdate
- render
- componentDidUpdate
- Unmount
- componentWillUnmount (通常和componentDidMount有关)
- Mount
- 组件向外传递数据(Based On Props)
- 局限性:组件与子组件维护重复的数据 -> Redux方案管理全局Data
- PropTypes
- Demo在新版本下问题:PropTypes已经不从react库引入 -> import PropTypes from 'prop-types'
Metadata
Metadata
Assignees
Labels
No labels