A simplified React-like library built for learning and experimentation with the core concepts of React — including JSX parsing, virtual DOM, hooks, and reconciliation.
Didact aims to replicate essential behaviors of React in a minimal and understandable way. The project is designed as an educational tool to understand how React works under the hood.
- JSX support (via Babel or pragma)
- Virtual DOM creation
- Basic DOM rendering
-
Use an object for the
style
prop
Parse thestyle
attribute from JSX as an object and apply it correctly to the DOM. -
Flatten
children
arrays
Ensure that nested arrays in JSX children (e.g., fragments ormap
) are flattened before rendering. -
Implement
useEffect
hook
Mimic the behavior of React’suseEffect
to manage side effects after render. -
Reconciliation by
key
Track and compare elements using thekey
prop to improve performance and avoid unnecessary DOM updates during diffing.
Install dependencies and start the dev server:
pnpm install
pnpm run dev
- [Build your own React](https://pomb.us/build-your-own-react) by Paul Henschel
- React source code: github.com/facebook/react
Carlos Matos