When should I use state in React?
Use state for data that changes over time due to user input, network responses, or timers. Do not use state for values that can be computed from props or other existing state, to avoid duplication and sync bugs.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in What Is State in React and Why It Drives Interactivity
State is internal data managed by a component that can change over time. When state changes, React re-renders the component so the UI reflects the new data. It is what makes React apps interactive.
Props come from the parent and are read-only inside the child. State is owned by the component and can be changed by it. Props are external inputs; state is internal memory.
Because React's model is that the UI is a function of state. When state changes, React re-renders the component and any children that depend on it so the UI stays in sync with the new data.
Still have questions?
Browse all our FAQs or reach out to our support team
