Course lesson

Change a Stateful React Class Component to a Function Component with the State Hook

In this lesson, you will learn how to take a class component which uses state and convert it to a function component which utilizes the State Hook. The state hook returns a two-item array: the first item is the state value and the second value is the function...

Duration
4 min
Access
Pro
Transcript
Available

In this lesson, you will learn how to take a class component which uses state and convert it to a function component which utilizes the State Hook. The state hook returns a two-item array: the first item is the state value and the second value is the function to update the state value.

Remember, Hooks can only be used in function components.