This project will create a simple re-creation of React.js. It will feature the following:
- A virtual DOM
- Lifecycle implementation
- Reconciliation following React heuristics
Step 1
Element-#createElementPOJO creatortypechildrenprops
Step 2
- Render an
ElementRLDOM#rendermethod
- Recursively render children
Step 3
- Unmount an
Elementfrom DOM- this will be a helper method when we update components
- Recursively unmount children first, then self
Step 4
#_diffbetween two element trees- compare roots
- if different, unmount prev, mount next
- if same
- compare the children
- try to salvage children with same key
- compare roots
Step 4
- Component
- create
Componentclass to extend - include lifecycle methods
- create
Step 5
- Handle Components in
_mount,_unmount,_diff- with lifecycle methods
Step 6
- create
setStatemethod
Step 7
- #TODO: add event handlers