Css module

 1:-components/style folder:--

filename:-Content1.module.css:

.bt{
    color:Red;
}


2:--

second file:-

Content2.module.css:

.bt{
    colorblue;
}


3.In the component folder js file:--

Content1.js

import React from 'react'
import secondcss from './style/Content1.
module.css'
export const Content1 = () => {
  return (
    <div>
        <button className={secondcss.bt}>click1
</button>
    </div>
  )
}


4:-another js file:-

import React from 'react'
import Firstcss from './style/Content2.
module.css'
export const Content2 = () => {
  return (
    <div><button className={Firstcss.bt}>
click2</button></div>
  )
}


Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation