State
Definition
Data that a component manages internally and can change over time. When state updates, React re-renders the component. Use `useState` for simple state and `useReducer` for complex state logic.
Code Example
Learn More
Related Terms
A reusable, self-contained piece of UI in React. Components accept inputs (props) and return JSX describing what should appear on screen. Can be functions (recommended) or classes.
PropsShort for properties — the mechanism for passing data from parent to child components in React. Props are read-only and flow downward (one-way data flow). Destructure props in function parameters for clean code.
useEffectA React hook for performing side effects in function components — fetching data, setting up subscriptions, or manually updating the DOM. Runs after every render by default; use the dependency array to control when it runs.