What is the virtual DOM?
Simple meaning
It is React's in-memory description of the UI as a tree of elements.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready Frontend Master questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
It is React's in-memory description of the UI as a tree of elements.
Open the full page for Why, Steps, Example and Key takeaway.
Keys tell React which item is which across renders so it can reuse DOM and state.
Open the full page for Why, Steps, Example and Key takeaway.
The input value comes from state and onChange updates that state, so React is the source of truth.
Open the full page for Why, Steps, Example and Key takeaway.
It stores a value for this component and queues a re-render when you call the setter.
Open the full page for Why, Steps, Example and Key takeaway.
JSX is HTML-like syntax that compiles to React.createElement or the new jsx runtime.
Open the full page for Why, Steps, Example and Key takeaway.
Props are inputs passed from parent to child and should be treated as read-only.
Open the full page for Why, Steps, Example and Key takeaway.
Context avoids threading the same prop through many layers, like theme or the current user.
Open the full page for Why, Steps, Example and Key takeaway.
Redux puts shared client state in one store with a strict update path: dispatch an action, reducer returns new state.
Open the full page for Why, Steps, Example and Key takeaway.
Next.js is a React framework with routing, bundling, and ways to render on the server.
Open the full page for Why, Steps, Example and Key takeaway.
CSR means the server sends JS and the browser builds HTML after download.
Open the full page for Why, Steps, Example and Key takeaway.
Hydration is React attaching to server-rendered HTML instead of throwing it away and painting from scratch.
Open the full page for Why, Steps, Example and Key takeaway.
An error boundary is a class component that catches render errors in its children and shows a fallback UI.
Open the full page for Why, Steps, Example and Key takeaway.
When two siblings need the same data, I move that state to the closest common parent and pass it down as props.
Open the full page for Why, Steps, Example and Key takeaway.
Hooks let us reuse stateful logic without HOCs and mixins.
Open the full page for Why, Steps, Example and Key takeaway.
UseEffect runs after paint for side effects: fetch, subscriptions, and syncing to document title.
Open the full page for Why, Steps, Example and Key takeaway.
React compares the new element tree with the previous one by type and key.
Open the full page for Why, Steps, Example and Key takeaway.
Inserting or reordering makes React reuse the wrong component instance, so inputs keep the wrong text.
Open the full page for Why, Steps, Example and Key takeaway.
The effect closes over stale props or state from the render that created it.
Open the full page for Why, Steps, Example and Key takeaway.
UseMemo memoizes a computed value.
Open the full page for Why, Steps, Example and Key takeaway.
It skips a re-render when props are shallow-equal.
Open the full page for Why, Steps, Example and Key takeaway.