Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Hide playlist

    Pass a function to setState in React

    Alex Jover MoralesAlex Jover Morales

    In React, when you want to set the state which calculation depends on the current state, using an object can lead to state inconsistency. This is due to the fact that React can batch multiple state changes for performance reasons.

    This lesson shows you how using a function in setState can solve that.

    You must be a Member to view code