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

Autoplay
Hide playlist

    Update state asynchronously in React using Promise and setState()

    In this lesson we will look at updating state in React based on the successful resolution of a promise making use of Promise.prototype.then. We will perform a user action such as clicking a button to delete an item and fire off a request to our API. Once our request is complete, we will update our component state based on current state using setState() with an updater function and remove the target item from the list with Array.prototype.filter.

    You must be a Member to view code