DEV Community

Discussion on: The state of React's state management for me

Collapse
 
ivan_jrmc profile image
Ivan Jeremic

I like to export a hook directly for usage of the store in your case add in store.tsx 'export const useAppState = () => useContext(AppContext);

You can now use it everywhere and it saves you imports in your components.

Collapse
 
akumzy profile image
Akuma Isaac Akuma

That makes sense thanks for the tips