DEV Community

Discussion on: Your next React Modal with your own "useModal" Hook & Context API.

Collapse
 
hrommi profile image
Stepan Zasimenko

Hi, nice article. But in the old version of the react documentation it is not recommended to save the components in the state. What do you think about it?

Collapse
 
alexandprivate profile image
Alex Suarez

Hi there Stepan, thanks for sharing, yes as you mentioned that's old but true!! I will not do it, in this case, this is just a quick example of how to solve a use case without fully refactoring the context, but you are totally right!! states = data.