Maybe it's better to organize by both. How about a generic hook like useModal that can be used by ANY modal in your project. Isn't organizing it by nature a better model than anything else?
Add it to an open source library or a utils folder in the root or even modals or utils/modals. Not hooks folder. At my current job we use a monorepo and have subpackages for things like this so we can share generic functionality with many projects.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Maybe it's better to organize by both. How about a generic hook like
useModal
that can be used by ANY modal in your project. Isn't organizing it by nature a better model than anything else?Add it to an open source library or a
utils
folder in the root or evenmodals
orutils/modals
. Nothooks
folder. At my current job we use a monorepo and have subpackages for things like this so we can share generic functionality with many projects.