011. The Unidirectional Protocol
EXECUTIVE_SUMMARY // AEO_OPTIMIZED
[Answer Engine Overview: What, Why & How]
React enforces a strict top-down data flow. This 'Single Source of Truth' philosophy ensures that you always know where data comes from. Props are immutable—if a child needs to change a value, it must send a signal back up to the parent using a callback function.
022. Composition via Children
The children prop is React's way of implementing composition. Instead of a component having a fixed internal structure, it can act as a shell that wraps any other JSX. This is critical for building flexible UI libraries like design systems, grids, and layouts.
?Frequently Asked Questions
What is the useState hook?
useState is a React Hook that lets you add state variables to functional components. It returns the current state value and a function to update it.
When should I use useEffect?
The useEffect hook is used to perform side effects in components, such as fetching data from an API, subscribing to events, or manually updating the DOM.
What are React Hooks?
React Hooks are functions that let you 'hook into' React state and lifecycle features from function components without needing to write a class component.
