DEV Community

Discussion on: Using custom hooks in place of "render props"

 
seanmclem profile image
Seanmclem

What was that sandbox link? I'd love to see a custom hook Sharing a consistent State across components. I feel like you can only do it with context, no?

Thread Thread
 
emeka profile image
Nwakwoke Patrick Nnaemeka • Edited

If by consistent you mean a global state, then you can only do that with context or any store that holds global state. Just create a hook that consumes your store