score:3
Accepted answer
i have been using sass/scss in my react applications by doing as create-react-app
's documentation recommends, and everything works fine. all you need is:
- step one
npm install sass --save
- step two
change your .css
files to .scss
.
score:1
this seem to work for me
npm install sass
page-heading.scss
.page-heading {
border: 3px solid red;
width: 100%;
&__divider {
border: 3px solid blue;
}
}
pageheading.js
import { typography, divider } from '@mui/material';
import 'components/page-heading/page-heading.scss';
function pagetitle({ props: pageheading }) {
console.log(pageheading);
return (
<typography component="h1" variant="h2" classname="page-heading">
<divider
sx={{
hyphens: 'auto',
whitespace: 'normal',
}}
classname="page-heading__divider"
>
{pageheading}
</divider>
</typography>
);
}
export default pagetitle;
Source: stackoverflow.com
Related Query
- Whats the best way to conditionally add readOnly in React?
- What is the best way to secure Firebase API keys in a react app so it is not accessible publicly?
- Best way to install sass in create react app
- What's the best way to add add sass/scss in a React app?
- what is the best way to deploy react app in lan only
- What's the best way to add social login (Sign in with Google) to existing email/password app and database?
- Which is the best way to store a list of data in localStorage and display them when searched using a React app
- NodeJS: What's the best way to share session between server-rendered views and React app
- What is the best way to connect React js app with node js server?
- Whats the best way to add an SVG to ReactJS
- What is the best way to build multi-language app with react and redux?
- What's the best way to prevent React app being scraped?
- What is the best way to add _.throttle on a react element?
- What is the best way to access redux store outside a react component?
- What is the best way to redirect a page using React Router?
- What is the best way to trigger onchange event in react js
- React + Redux - What's the best way to handle CRUD in a form component?
- What is the best way to deal with a fetch error in react redux?
- Whats the best way to update an object in an array in ReactJS?
- Best way to polyfill ES6 features in React app that uses create-react-app
- What is the quickest way to convert a React app to React Native?
- What is the best way to add a value to an array in state
- React - What is the best way to handle login and authentication?
- What's the easiest way to use Create React App with Relay?
- Is there a way to tell when your react app page is done loading the page / assets?
- Best way to deploy react app with gitlab-ci?
- Best way to compress an image Javascript React Web App
- A way to know the version of the build of an React App
- What is the best way to implement undo state change (undo store/history implementation) in React Redux
- Best way to add asset path variable with React and JSX?
More Query from same tag
- React componentDidMount and setState not seeming to cause a rerender to show my component
- No member named 'cancelButtonTintColor' in 'JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions'
- Dynamically adding and deleting row in empty ag-grid,first time row is getting deleted, second time throwing error
- Images only render when delay 1 second then setState
- Form validation: output of error message
- Get RSA keys in Crypto-Js
- Warning: Functions are not valid as a React child, using a conditional rendering
- React Native UI components: RCTBubblingEventBlock/RCTDirectEventBlock do not seem to work
- Restyle React child components dynamically from parent by a certain property
- What is the best way to create component library for both React and Preact?
- How to fix expected to return a value at the end of arrow function warning in react js?
- How to stop all react-youtube videos onSlide with react-image-gallery?
- REACT ADMIN | TEXTINPUT CHANGE VALUE
- ESLint: to fix this, wrap the initialization of constant in its own useMemo()
- more components connected to redux or less? react
- Setting the state within a request module
- how to deploy react app with github gh-pages
- Cannot access 'actionCreator' before initialization
- How to handle relationships in a Flux application?
- create-next-app' is not recognized as an internal or external command, operable program or batch file
- Select the current element with the jquery in the react
- How to move BasemapGallery position in ReactJS Leaflet?
- need to refresh page after axios call
- Calling and passing API data to other component in React.js
- How to trigger a modal when clicking on a dropdown item in Semantic UI React?
- why are we binding 'this' keyword for event handlers in react class components?
- How to chain two filters in react.js
- Geeting dropdown options, with suggestions on top
- How to implement remote: true for react (rails)?
- fetch nested object from array in JavaScript?