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

    Add state to functional React component with useState hook without introducing a class

    reactReact

    Most React developers knows the pain of refactoring a functional component only because we would like to add a state to it.

    In this lesson we are going to learn a new way of handling that - React 16.7 alpha introduces a concept of hooks, which allow us to well... hook into existing React features (such as state) from inside of a functional component. By using a useState hook we introduce state to a Counter component without introducing a class.