ReactJs under the hood
Advanced concepts (internal)
This is a video where Dan Abramov implements a new feature in reactjs live. The new feature is a tag named lol and also a strip one to get rid of all divs.
- reactjs has a complex code base
- packages has a source folder
- each package has its own responsibility
- no restriction where to put tests -> for this screen cast it was under reactjs DOM
- test first
- writing a test for squashing divs
- easy way
- for div without styles prefer fragments
- hard way
- react keeps its internal tree called Fiber tree
- react steps into each Fiber until it has no children to walk(start) into and then flushes things to DOM(commit)
- ReactWorkTags = all possible Fiber types
- Fibers are reused
- copy of initial fiber is done 16+
- reconcile
- begin (ReactFiberBeginWork)
- complete (ReactFiberCompleteWork)
- commit (ReactFiberCommitWork)
Resources
- React - The Complete Guide (Includes Hooks, React Router, and Redux) - Second Edition - Course 47h - by Academind by Maximilian Schwarzmüller
- Reactjs app structure: paper in pdf format with the idea behind the testable folder structure
- The future of React - changelog podcast
- React Server Components with Dan Abramov, Joe Savona, and Kent C. Dodds
- Hooks + multiple instances of React · Issue #13991 · facebook/react · GitHub
-
https://ui.dev/c/react/why-react
- payed course with lessons to watch for free