|
|
|
|
|
by gabemart
3079 days ago
|
|
>However, for root components of a directory, use index.jsx as the filename and use the directory name as the component name I used to do this, but I find it really confusing having dozens of files all called "index.jsx". I eventually moved to './ComponentName/ComponentName.jsx' in my personal projects. It's a bit more verbose, but I find it makes everything else do to with navigating and finding files easier. |
|
You can still import it as `./ComponentName` as you would with having `index.jsx` inside the folder. Best of both worlds, IMO.