What is hydration?
Hydration attaches React behavior to server-rendered HTML so the existing markup becomes interactive.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 3157–3168 of 3610 questions
Hydration attaches React behavior to server-rendered HTML so the existing markup becomes interactive.
It occurs when server HTML differs from the client's initial expected render.
Optimistic UI updates the interface before the server confirms a mutation, then reconciles or rolls back if it fails.
Suspense displays a fallback while supported child operations, such as lazy code loading or framework-integrated data, are pending.
Place state at the lowest common owner that needs it, sharing only when multiple consumers need coordination.
Use a string literal union such as 'primary' | 'secondary' | 'danger' so invalid values are caught by TypeScript.
Related components coordinate through composition or context to provide a flexible declarative API, such as Tabs and TabPanel.
A component receives a function prop that returns UI, letting consumers control rendering while sharing behavior.
A higher-order component is a function that takes a component and returns an enhanced component.
A polymorphic component accepts an element type and combines that element's props with its own while resolving prop conflicts.
Extend the appropriate React HTML attribute type, add custom props, and pass supported attributes to the underlying element.
Unit tests check isolated logic, integration tests check collaborating parts, and end-to-end tests exercise user journeys through the running app.