DEV Community

Discussion on: Should a custom React Hook be in 2 files? Also... should a reusable component be in one file?

Collapse
 
0916dhkim profile image
Danny Kim

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.