1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

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

    reactReact
    ^16.8.6

    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.