/m-react

build your own mini react

Primary LanguageTypeScriptMIT LicenseMIT

m-react

  • this is a repo to build your own mini react

what has been achieved

basic

  • support jsx & tsx (use vite to automatically compile it)
  • fiber architecture
  • support function component (optional props)
  • commit dom modifications uniformly (commit root)
  • support event listener
  • reactivity by useState

hooks

  • useState
  • useEffect with cleanup

to do

React hooks

  • useMemo
  • useRef

others

  • 🙋 a guide for this project which specify how this mini-react works (createElement, performWorkOfUnit, reconcile, commitRoot......)
    • this will open as issue for a better reading experience
  • 🤔 maybe this project needs a better way to organize code

Last

  • 😻 this project still remains numerous deficiencies, pr/issue welcomed!
  • 😁 enjoy your life!