Answer the question
In order to leave comments, you need to log in
How to structure a project in React?
The project has separate folders for hooks and components /src/hooks & /src/components.
Now we need to make some functionality of the alert and for this we need a provider, a component and a hook (AlertProvider, Alert, useAlert). The question was how best to place it. At first I thought to make an Alert folder in /src/components and export everything from it at once, but somehow it seems to be wrong that the hook will be exported from the components folder. Or throw the hook separately into the folder with hooks, and leave Alert and AlertProvider in the folder with the components, but then there is a separation of a single entity.
There is a desire to create a folder in the spirit of plugins and stuff everything you need into the Alert folder, but I googled various kinds of react application structures and did not observe anything like this anywhere. Actually the question is how to solve this moment correctly? Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question