When it comes to using SASS in React, the first step is...
To get started, you need to install node-sass
and then add import ./mysass.scss
in your index.js
file.
I followed these steps successfully with Bootstrap's SASS integration.
In fact, I managed to import bootstrap.scss
into my index.js
file without any issues.
import 'bootstrap/scss/bootstrap.scss';
However, when I attempted to import my own SASS files, they didn't seem to work as expected.
Let me provide some details about my unique SASS files.
My style.scss file involves importing other CSS modules through the use of
@use
, instead of the traditional@import
method in SASS.For instance:
Instead of -> `@import 'sections/navbar';` I am using -> `@use 'sections/navbar';`
Additionally, I make use of
@use "sass:map";
Could this approach of using @use
be causing the issue?
Upon inspection, I noticed that the bootstrap.scss
file employs @import
.