If using create-react-app then:

1)First install sass dependency using npm:

npm install sass --save-dev

2)Import your sass file to your componentName.js file

import '../scss/FileName.scss';

Answer from restricted-beam on Stack Overflow
🌐
Create React App
create-react-app.dev › docs › adding-a-sass-stylesheet
Adding a Sass Stylesheet | Create React App
July 7, 2021 - @use 'styles/_colors.scss'; // assuming a styles directory under src/ @use '~nprogress/nprogress'; // loading a css file from the nprogress node module Copy
🌐
Bitstack
blog.bitsrc.io › how-to-use-sass-and-css-modules-with-create-react-app-83fa8b805e5e
How to Use SASS and CSS Modules with create-react-app | by Esau Silva | Bits and Pieces
March 4, 2025 - Once that is done, open ./src/App.js and in line 3 you will find import './App.css'. Change it to import './App.scss' ... You will see the default template created by create-react-app looking good!
🌐
Medium
medium.com › nerd-for-tech › add-sass-to-your-react-app-in-2021-here-is-how-c7260c323a5a
Add Sass to your React App in 2021! Here is how. | by Austin Evans | Nerd For Tech | Medium
March 14, 2021 - Node/Sass is deprecated, Dart Sass is here. Learn how to get Sass set up in your React App with these easy steps.
🌐
DEV Community
dev.to › jlargs64 › how-to-add-sass-to-your-create-react-app-in-2022-4c8e
How to add sass to your create-react-app in 2022 - DEV Community
January 5, 2022 - Then, create a Sass file in the src directory of your React app, we'll call ours main.scss
🌐
W3Schools
w3schools.com › react › react_sass_styling.asp
React Sass Styling
In the newly created .scss file, ... ... import { createRoot } from 'react-dom/client'; import './MyStyle.scss'; function MyHeader() { return ( <h1>My Header</h1> ); } createRoot(document.getElementById('root')).render( <MyHeader /> );...
🌐
GitHub
github.com › the-road-to-learn-react › create-react-app-with-sass
GitHub - the-road-to-learn-react/create-react-app-with-sass: Showcasing on how to use SASS in create-react-app
TLDR: It can be used by installing node-sass on the command line with npm install node-sass --save and then by using the .scss extension instead of the .css extension for your CSS files.
Starred by 10 users
Forked by 7 users
Languages   JavaScript 73.3% | HTML 19.2% | CSS 7.5% | JavaScript 73.3% | HTML 19.2% | CSS 7.5%
🌐
Robin Wieruch
robinwieruch.de › create-react-app-with-sass-support
How to use SASS in create-react-app?
October 3, 2018 - A short guide on how to add Sass support to your create-react-app application which shows you how to setup Sass, but also how to use it in your React components ...
Find elsewhere
🌐
GitHub
github.com › rickharrison › create-react-app-sass
GitHub - rickharrison/create-react-app-sass: Add sass support to create-react-app.
Enhances create-react-app to include support for Sass. ... "scripts": { "start": "react-scripts-with-sass start", "build": "react-scripts-with-sass build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" }, Your src directory will automatically re-compile any .scss file into a .css file with the same name in the same location.
Starred by 41 users
Forked by 5 users
🌐
Medium
medium.com › @oreofeolurin › configuring-scss-with-react-create-react-app-1f563f862724
How to Configure React with SASS/SCSS (create-react-app) | by Olurin Oreofe | Medium
November 5, 2018 - How to Configure React with SASS/SCSS (create-react-app) NOTE: For latest version of create-react-app (since react-scripts@2.0.0) all you need to do is install node-sass and import a file with the …
🌐
Jointjs
resources.jointjs.com › tutorials › joint › tutorials › ReactTs.html
JointJS+ - React example app with TypeScript and SCSS using create-react-app
npx create-react-app react-rappid --template typescript · After a couple of seconds, a new React project should be created. In this tutorial, we will be adding SCSS support, but this next step is entirely optional, and not required for the application to function successfully.
🌐
HackerNoon
hackernoon.com › how-to-use-sass-in-your-create-react-app-oh2x3ywb
How To Use SASS In Your Create-React-App | HackerNoon
April 21, 2020 - Create-react-app is facebook's attempt at setting up a developer to get started building react apps very quickly. It is a boilerplate that comes pre-configured with a wide array of tools and technologies that ensure a smooth running react ...
🌐
DEV Community
dev.to › ijash › adding-sass-to-create-react-app-433i
Adding SASS to create-react-app - DEV Community
June 6, 2021 - as per this post date, I use react version ^17.0.2. In new project, install sass. ... Rename App.css to App.scss.
🌐
GitHub
github.com › facebook › create-react-app › blob › main › docusaurus › docs › adding-a-sass-stylesheet.md
create-react-app/docusaurus/docs/adding-a-sass-stylesheet.md at main · facebook/create-react-app
For example, instead of using a .Button CSS class in <AcceptButton> and <RejectButton> components, we recommend creating a <Button> component with its own .Button styles, that both <AcceptButton> and <RejectButton> can render (but not inherit). Following this rule often makes CSS preprocessors less useful, as features like mixins and nesting are replaced by component composition. You can, however, integrate a CSS preprocessor if you find it valuable. ... Now you can rename src/App.css to src/App.scss and update src/App.js to import src/App.scss.
Author   facebook
🌐
npm
npmjs.com › package › create-react-app-sass
create-react-app-sass - npm
November 11, 2016 - Latest version: 1.1.0, last published: 9 years ago. Start using create-react-app-sass in your project by running `npm i create-react-app-sass`. There are no other projects in the npm registry using create-react-app-sass.
      » npm install create-react-app-sass
    
Published   Oct 11, 2016
Version   1.1.0
Author   Rick Harrison
🌐
Upmostly
upmostly.com › home › tutorials › create react app with sass
How to Setup Create React App with Sass (Code Examples)
November 5, 2022 - To get started, open a terminal window at the root of your create react app project and install the node-sass library. We’ll install and save node-sass in our development dependencies because Sass is a development tool.
🌐
Medium
connorelsea.medium.com › using-sass-with-create-react-app-7125d6913760
Adding Sass or Scss to Create-React-App | by Connor Elsea | Medium
May 16, 2023 - Create react app uses multiple ... of assets. To add Sass or Scss to this project, you will be adding a loader that can process Sass and Scss files....
🌐
Create React App
create-react-app.dev › docs › adding-a-css-modules-stylesheet
Adding a CSS Modules Stylesheet | Create React App
January 4, 2019 - Tip: Should you want to preprocess a stylesheet with Sass then make sure to follow the installation instructions and then change the stylesheet file extension as follows: [name].module.scss or [name].module.sass. CSS Modules let you use the same CSS class name in different files without worrying about naming clashes. Learn more about CSS Modules here. ... import React, { Component } from 'react'; import styles from './Button.module.css'; // Import css modules stylesheet as styles import './another-stylesheet.css'; // Import regular stylesheet class Button extends Component { render() { // reference as a js object return <button className={styles.error}>Error Button</button>; } } Copy
🌐
GitHub
github.com › philosophie › react-sass-styleguide
GitHub - philosophie/react-sass-styleguide: Example Create React app using Sass and Bootstrap · GitHub
We've picked Bootstrap for this project, and since we're using React, we'll bring in React Bootstrap. ... Note: If you need to 'customize' the default Bootstrap theme, create a _custom.scss file inside the styles/settings folder.
Starred by 9 users
Forked by 2 users
Languages   JavaScript 63.8% | CSS 26.0% | HTML 10.2%
🌐
MakeUseOf
makeuseof.com › home › programming › how to use sass in react
How to Use Sass in React
July 1, 2023 - Check out our guide on how to use CSS variables for more details. First, create a new Styles folder in your src folder. In the Styles folder, create two files: _variables.scss and _mixins.scss.