Recall & Review
beginner
What is state in React?
State is a way to store and manage data inside a React component that can change over time. It helps the component remember information and update the screen when that information changes.
Click to reveal answer
beginner
How do you create state in a React functional component?
You use the
useState hook to create state. It gives you a variable to hold the value and a function to update it.Click to reveal answer
beginner
Why is state important in React components?
State lets components remember things like user input or choices. When state changes, React updates the screen automatically to show the new data.
Click to reveal answer
beginner
What happens when you update state in React?
When you update state, React re-renders the component to show the latest data on the screen.
Click to reveal answer
beginner
Can state be changed directly in React?
No, you should never change state directly. Instead, use the updater function from
useState to change state safely.Click to reveal answer
What hook do you use to add state in a React functional component?
✗ Incorrect
The useState hook is used to add state to functional components.
What happens when you update state in React?
✗ Incorrect
Updating state causes React to re-render the component with new data.
Which of these is the correct way to update state?
✗ Incorrect
State should be updated using the updater function from useState, not by direct assignment.
State in React is used to:
✗ Incorrect
State stores data that can change and affects what the component shows.
Which of these is NOT true about React state?
✗ Incorrect
State should never be changed directly; always use the updater function.
Explain in your own words what state is in React and why it is useful.
Think about how a component remembers user actions or input.
You got /3 concepts.
Describe how you create and update state in a React functional component.
Focus on the useState syntax and how changes affect the component.
You got /4 concepts.