Skip to main content
React Output Prediction Easy +10 XP

useState Initial Value

What is the initial value of count?

ReactRead-only
const [count, setCount] = useState(0);

What is the output?

Show answer and explanation

Answer: 0

useState(0) initializes the state variable count to 0.

Hint: The argument to useState is the initial value.

What this challenge tests

Output Prediction in React: hooks, state.

Related challenges