Lesson

Use React Hooks to Convert a Class Component to a Function Component

React just announced a new Hooks) proposal enabling React Function Components to handle state and side-effects, which was previously only possible with React Class Components. In this lesson, we will be using a prerelease of React to convert a React Class...

Duration
6 min
Access
Free
Transcript
Needs source

React just announced a new [Hooks](Introducing Hooks – React) proposal enabling React Function Components to handle state and side-effects, which was previously only possible with React Class Components. In this lesson, we will be using a prerelease of React to convert a React Class Component to a Function Component using hooks, and then at the very end we'll introduce a custom hook to simplify the component even further.