What and why React?
Effecient DOM updates for interactions
Component based mental models
Declarative structure JSX
Large ecosystem
Beyond SPA - SSR for SEO and Loading performance; Streaming
beyond the web to mobile and desktop
How is React efficient?
Fiber Architecture
Virtual DOM vs Real DOM, diffiing
Batch updates - batching
How can you stop automatic batching?
flushSync API to immediately push updated to DOM
What is HOC?
cross cutting cocerns
decorate component with props or statful logic
Its a pattern not a React thing
What is pure component?
same input same output
What is props?
immutable data that is passed into a component
- use for components to communicate within the component tree
- parent to child communication.
- child-to-parent communication via callbacks props
- descendants communication if no context
What is state?
How do update a nested object state?
spread each nesting in the React’s setter
Immner for third party approach
What is react key prop and why is it very important?
Keys help React identify which children are the same between renders. They are used during reconciliation so React can correctly preserve, move, add, or remove component instances. Stable keys are especially important in dynamic lists because they prevent bugs like incorrect state sticking to the wrong item.