Yatharth K
Frontend Architect, PushOwl
yatharthkhatri
Understanding of
I hate (unravelled) mysteries
Everything you witness from now on is OVERSIMPLIFIED version of actual concepts for your own good and for EDUCATIONAL purpose only. 😝
React Reconciler is the smart diffing algorithm that helps React figure out which DOM elements to update on state change.
Literally, in simplest terms, React Fiber is just an object that holds all the information of a component.
Understand that React library has two parts:
Since hooks are closely related to and dependent on core i.e. reconciler, fiber, .., they go into "react" module
Consider this
ReactDOM.render(
<App />,
document.querySelector('#root'),
)Render <App /> component
Create and give me a Fiber for <App />
<App />
<App />
Component
Component Fiber
<App />
props,
memoizedState,
sibling,
child,
ref, ...
component is Class or Function?
(Class Component)
(Functional Component)
Consider our <App /> component to be:
function App() {
const [count, setCount] = useState(0);
const [name, setName] = useState('Anonymous');
useEffect(() => {
...
})
return (...)
}Number of hooks:
useState - 2
useEffect - 1
Rendering with hooks (Mounting)
Rendering with hooks (Updating)
yatharthkhatri
yatharthkhatri