Skip to main content

State and the useState Hook

Learn State and the useState Hook (Fundamentals of React, ReactJS) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is State? • State is data that belongs to a component and can change over time — unlike props, state is owned and managed BY the component itself, not passed in from outside. • When state changes, React automatically re-renders the component to reflect the new value on screen. • The useState Hook is how a functional component declares state.

More lessons in Fundamentals of React