Become a member
to unlock all features

Create egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Handle multiple state values when using useState React hook


    Note: React hooks are currently in React v16.7.0-alpha and being discussed in an open RFC.

    When using the useState hook it's important to remember that the function updating the state returned from this hook works a little different than the setState from React.Component. In this lesson we are going to learn how we can handle multiple state values when using the React useState hook following an example of a simple app with two counters to highlight possible issues we might encounter and how to solve them.