1 min readJun 21, 2020
- I will place the modal component in the same file as the page that it is rendered on. For example, If I have a
LoginModal
that is displayed on theHomePage
, I will define that component in theHomePage.tsx
file. - I keep everything in the same file, as long as it’s not being used anywhere else. I often have multiple components in the same file, and for complex state I will write a custom hook.
Hope that helps!