How To Use Sass/SCSS In React

Using React is the new and modern way of building front-end web application, for me basically it is the latest efficient way to build web application, you can be more productive and the codes write would be much much more cool.

And you will getting much much more better if you replace a classic CSS file with SCSS, if you don't know what it is, SCSS is super set of CSS, it means that you can write normal CSS within it, with additional for example variable support. Your code will be 100% better.

To use React and Scss, you can simply just install the SCSS dependency, and React will handle it in the background, no need any configuration. Just doing these:

1. Add SCSS to your project:

npm install node-sass --save

2. Now on your App.js, instead of loading CSS file, you change it to CSS for example:
import './App.css' become import './App.scss';

That's it, now you can run your app again by npm start.


Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

How To Connect SSH Using PEM Certificate On Windows

Which Better WinZip vs WinRAR? Windows Zip and Unzip Tools

How To Create Spring Boot Project Using Netbeans

Spring Kafka - how to use ReplyingKafkaTemplate send and reply synchronously