Returning null from setState in React 16

added by JavaScript Kicks
5/31/2019 1:19:59 PM

736 Views

React 16 lets you decide whether state gets updated via .setState to prevent unnecessary DOM updates. Calling .setState with null no longer triggers an update in React 16. We'll explore how this works by refactoring a mocktail selection app that updates even if we choose the same mocktail twice.


0 comments