Handle multiple state values when using useState React hook

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

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.