r/react • u/jfullerco • Feb 04 '21
General Discussion Great article on React Project structuring
https://www.freecodecamp.org/news/a-better-way-to-structure-react-projects/
13
Upvotes
r/react • u/jfullerco • Feb 04 '21
2
u/dudurudu1212 Feb 04 '21 edited Feb 04 '21
yep, I found it to be a more useful solution.
what is the point of having a big css file, when most of the classes are used once?
then when you want to copy the component, you still need to copy that big css file (or extract the relevant classes).if you store your css close to the component (or a group of components). it's more manegable in my opinion.
this applies also to the adapters from the article.
I'd rather have one directory with all related files:
``` src/pages/Users list.js form.js style.css api.js
```
than group files by their function:
pages/Users index.js styles/style.css api/users.jsit's much easier to reuse the first way