I have two Components Login and Register with different separate styles.
// Login.jsx
import "../../Login.scss";
function Login() {
return (
<>
<div>Login</div>
</>
);
}
export default Login;
// Register.jsx
import React from "react";
import "../../Register.scss";
function Register() {
return (
<>
<div>Register </div>
</>
);
}
export default Register;
I have set different background color of both files, that is
// Login.scss
div{
background-color: red;
}
// Register.scss
div{
background-color: aqua;
}
I have rendered both components in App.js but both the components have only one style applied i-e Register.scss even I have not imported it in Login.jsx but still in Login.jsx getting the style of Register.scss instead of Login.scss
what could be the possibl reason?
Can I apply same className styles by differentiating with different import paths?