React PowerPlug is a set of pluggable renderless components to help you prototype quickly. These components don't actually render DOM to the page but contain the state and logic for you to power your presentation components via render props. In this lesson we'll look at the <State>
component and re-create the traditional counter example to see the potential of React PowerPlug.
In the new setState
calls, shouldn't we use the function form so nothing can go wrong with batching of setState
?
In the new
setState
calls, shouldn't we use the function form so nothing can go wrong with batching ofsetState
?
I meant to refactor this to be a functional component which cleans things up substantially and helps show the power of the wrapping State component. I haven't experienced an issue with conflicting setState
yet but you make a valid point!
^ Next lessons will utilize functional components + React PowerPlug