Introducing CSS Modules

The first of these are CSS Modules, and in Create React App 2 and higher, you don't need to do anything at all to start taking advantage of it immediately. CSS Modules give you the ability to modularize any CSS code that you import in a way that prevents introducing global, overlapping namespaces, despite the fact that the end result is still just one giant CSS file.

That being said, it's also not just going to immediately work in your project if you don't turn anything on or organize your code a little bit better. Right now, we've been placing all of our code directly into the src/ directory, resulting in a scenario where the root folder is going to keep growing and growing over time until it gets so large and unwieldy that you'll never be able to find anything.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset