Content pfp
Content
@
0 reply
0 recast
0 reaction

Joe Toledano pfp
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

df pfp
df
@df
The only good reason to nest in folders is when you have multiple colocated files for the Component (such as ComponentName.scss, or next.js's new layout.ts and route.ts), or you're nesting them to match the file path to the url schema, and need to nest another route within this one. Otherwise simpler not to nest
2 replies
0 recast
2 reactions

df pfp
df
@df
Nesting and calling all the files index.ts makes results on CMD + P or search much harder to read
0 reply
0 recast
1 reaction

Joe Toledano pfp
Joe Toledano
@joetoledano
Yeah that definitely makes sense from a functionality standpoint
0 reply
0 recast
0 reaction