23
trogus
8y

React is a nice js framework, but I constantly find myself with 50 different files open because every component and related css file is spread across the world. I get why our frontend guy built it with so many modular components, but it makes me feel like back in the day when libraries were a thing and you had to flip through those giant Dewey decimal system drawers of cards to pull out the one little card you want to then hunt for that one little book you wanted to find that one little line from

Comments
  • 3
    I see where you are coming from, we using react native at our company and we have an internal library of 50+ components.

    But I do sort of like this, it means every component and its functionality is isolated away and easier to debug.

    I've not done much work in plain react before, but instead of a separate stylesheet.css file we use the react-native inline styles. So they are declared in the file without css!
  • 4
    @Michael-Hancock nice, haven't had a chance to do react native yet, it's just web at work.

    The killer is going through in chrome, seeing something that needs changing, inspect with chrome dev tools, and I can't just quickly copy/paste to search for that class name to change the css, I have to search for the associated filename, but there is the base .js and .css files with the same name that make up the component, so pick the right file and then find the class I was looking for. A few small changes to the same page can involve a handful of different components, and all those extra seconds add up. And my IDE now has a dozen files open, so back and forth between files and I'm juggling to remember which thing was in which component... gets to me some days
  • 1
    @trogus that's rough... Are you using the react devtools extension? or CSS modules by chance?
  • 1
    @tytho react devtools extension looks solid, thanks for the tip!
Add Comment