I've been studyng about Context API and useReducer hook, but i found nothing talking about pattern or file structure to use in projects with that.
I got to this structure:
Inside the context folder, i have the context itself and the reducer that controls the context state.
And in the component, i never (or almost never) access the context directly, leaving this job to a custom hook.
The complete code is here
What you think or comment about this ?
Top comments (0)