An open API service indexing awesome lists of open source software.

https://github.com/waynecz/tiny-react-with-hooks

⚛︎ Fundamental Implementation of React with Hooks & VDOM
https://github.com/waynecz/tiny-react-with-hooks

hooks react

Last synced: about 1 year ago
JSON representation

⚛︎ Fundamental Implementation of React with Hooks & VDOM

Awesome Lists containing this project

README

          









A concise version of React just good enough for building uncomplicated UI
deadly suitable for SDK which cares about the size





npm i @waynecz/react




Features

- Basic JSX and Renderer with VirtualDOM(diff & patch)
- Functional Component
- Hooks like `useState` / `useEffect`


Todo

- [ ] `useCallback` / `useMemo` ...


Demos

- [Simple usage](https://codesandbox.io/s/2pkyw29ymp)
- [Advanced: A Feedback UI](https://codesandbox.io/s/n7yvzjrkoj)

![](./assets/simple-demo.gif)




References

- [《Gooact: React in 160 lines of JavaScript》](https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f) by [Paul Marlow](https://github.com/sweetpalma)
- [《React as a UI Runtime》](https://overreacted.io/react-as-a-ui-runtime/) by [Dan Abramov](https://overreacted.io)
- [《从零开始实现一个 React》](https://github.com/hujiulong/blog/issues/4) by [Jiuling Hu](https://github.com/hujiulong)
- [《React hooks: not magic, just arrays》](https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e) by [Rudi Yardley](https://github.com/ryardley)