cpreact
cpreact copied to clipboard
Build React from Scratch :tada:
Phisolophy
- 复现 React 的轴心
- 支持现代浏览器
Implement React from 0 to 1
- 0.前置准备
- 1.JSX 和 Virtual DOM
- 2.组件 和 state|props
- 3.生命周期
- 4.diff 算法
- 5.setState 优化
- 6.ref 实现
- 7.PureComponent 的实现
- 8.HOC 探索
- 9.onChange 事件以及受控组件
- [ ] 性能测试
- [ ] 沙盒中使用
Usage
yarn install
yarn start
执行完上述命令后,会自动在浏览器 localhost:8080 上展示 hello,cpreact。

Practice
Test Travel
以 preact 的测试用例为干线进行 TDD, 进度如下:
yarn test
- [x] exports
- [x] createElement
- [ ] components
- [ ] keys
- [ ] lifecycle
Contribution
Welcome to contrubute this proj, you can read how to pr.
Thanks
Especially thank simple-react、preact、react for the guidance function of this library.