how can I change React sharing behavior of an external CSS file in React, so I can set the body background different for different components?
login.css
body {
background-image: url('../../../images/bannerbackground.png');
}
home.css
body {
background-color: rgb(185, 174, 160);
}
but for react's sharing behavior with the components of the same root I cannot differentiate it, is there any solution?
Yes there is a solution. Its pretty simple. To prevent the clashes you can implement CSS modules. Rename your CSS files to
filename.module.cssResult: