- 复现 React 的轴心
- 支持现代浏览器
- 0.前置准备
- 1.JSX 和 Virtual DOM
- 2.组件 和 state|props
- 3.生命周期
- 4.diff 算法
- 5.setState 优化
- 6.ref 实现
- 7.PureComponent 的实现
- 8.HOC 探索
- 9.onChange 事件以及受控组件
- 性能测试
- 沙盒中使用
yarn install
yarn start
执行完上述命令后,会自动在浏览器 localhost:8080
上展示 hello,cpreact
。
以 preact 的测试用例为干线进行 TDD, 进度如下:
yarn test
- exports
- createElement
- components
- keys
- lifecycle
Welcome to contrubute this proj, you can read how to pr.
Especially thank simple-react、preact、react for the guidance function of this library.