I am using scss and creating final css which is a combination of header footer etc components which remain the same across pages.
Say I have the below class and they are of the same names in two pages of mine say About us Component and Home page Component which different styles
.first-section {
}
import React from 'react'
import Header from './headers/Header'
import Footer from './footers/Footer'
import LeftDrawer from './LeftDrawer'
import '../../../../media/assets/css/landingpages/aboutus.css'
export default class AboutUs extends React.Component {
render() {
return (
<div class="page-container">
<LeftDrawer></LeftDrawer>
<div class="page-container-inner" id="about-us">
<Header></Header>
<article class="first-section text-center">
</article>
<Footer></Footer>
{/*<!-- /.page-container-inner -->*/}
</div>
{/*<!-- /.page-container -->*/}
</div>
)
}
}
Similarily Home.jsx
import React from 'react'
import Header from './headers/Header'
import Footer from './footers/Footer'
import LeftDrawer from './LeftDrawer'
import '../../../../media/assets/css/landingpages/home.css'
export default class Home extends React.Component {
render() {
return (
<div class="page-container">
<LeftDrawer></LeftDrawer>
<div class="page-container-inner" id="about-us">
<Header></Header>
<article class="first-section text-center">
</article>
<Footer></Footer>
{/*<!-- /.page-container-inner -->*/}
</div>
{/*<!-- /.page-container -->*/}
</div>
)
}
}
How do I prevent these from clashing in React? cz they are of same names
.first-sectionclass but they should have different styles for different pages?