Content
@
0 reply
0 recast
0 reaction
Joe Toledano
@joetoledano
In your apps, do y'all set up single components as single files or as files within folders? For example: ComponentName.tsx vs. ComponentName -- index.tsx
4 replies
0 recast
2 reactions
Carlos Matallín
@matallo.eth
components - ComponentName - ComponentName.tsx - index.ts - index.ts
2 replies
0 recast
3 reactions
Joe Toledano
@joetoledano
Interesting, this may be a dumb question but what are the benefits of doing: ComponentName - ComponentName.tsx - index.tsx Vs. ComponentName - index.tsx
1 reply
0 recast
0 reaction
Carlos Matallín
@matallo.eth
No dumb question, there’s no silver bullet when it comes to project file structure. I think mostly for searching the file in the IDE
3 replies
0 recast
2 reactions
scottrepreneur
@scottrepreneur.eth
The main advantage of the former is that you don't have a bunch of index.tsx labels across the open files. Having the actual component name and exporting from index gives the editor a bit more clean feel when jumping around open files.
1 reply
0 recast
1 reaction
Joe Toledano
@joetoledano
Ah yeah I can potentially see how that'd be helpful, at the same time though, having that extra file sort of seems a bit superfluous to me. To each their own 🤝
0 reply
0 recast
1 reaction