DEV Community

Discussion on: How to pass state between components in reactjs

Collapse
 
zeyadetman profile image
Zeyad Etman • Edited

Thanks Thomas, to your first question, you're right it'll be prettier, you're welcome to contribute and update this on GitHub repo.
To your second question, from Reactjs documentation

"The second parameter to setState() is an optional callback function that will be executed once setState is completed and the component is re-rendered."

and this what i want.

Collapse
 
keabard profile image
Thomas Simonnet

I was talking about the first parameter :)