When you make a react hook, should it be in one file or 2? Such as news.JS and setNews.JS?
Also, when you make a reusable component such as a “to do”, do you want the info in the same file as the template “render or return”?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
I would name the custom hook module
useNews.js
(one file). That way, it is less confusing where to import the hook. For components, I prefer putting everything inside one module (e.g.Todo.jsx
), as long as it stays under 500 lines of code.