Advanced
Joe Toledano@joetoledano
9/15/2023

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

In reply to @joetoledano
Carlos Matallín@matallo.eth
9/15/2023

components - ComponentName - ComponentsName.tsx - index.ts" target="_blank" rel="noopener">index.ts - index.ts

In reply to @joetoledano
Carlos Matallín@matallo.eth
9/15/2023

components - ComponentName - ComponentName.tsx - index.ts" target="_blank" rel="noopener">index.ts - index.ts

In reply to @joetoledano
David Furlong@df
9/15/2023

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

In reply to @joetoledano
Tayyab@tayyab
9/15/2023

Similar to @matallo.eth mind my mismatched spellcase, I've been too lazy to fix it, but also keep telling myself i have higher priorities

In reply to @joetoledano
Salief@salief
9/17/2023

Usually single files, but for larger components they are grouped in a folder.