Articles → REACT.JS → Sass in react.js

Sass in react.js






Purpose





Example




$Color: red;
h1 {
	color: $Color;
}




import React, { Component } from 'react';
import ReactDOM from 'react-dom'
import './style.scss';


class FormComponent extends React.Component {    
    
    render() {
        return (
            <h1>Hi</h1>
        );
    }
}

ReactDOM.render(<FormComponent />, document.getElementById('root'));



Output


Picture shows how Sass is used in react.js

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, August 23, 2021

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250