I have two routes in my React app: /a and /b .
For / a, I want the body css tag to have background-color: red; .
For / b, I want the body css tag to have background-color: blue; .
Both components a and b live in different .JSX files, and both import their own main.scss file, which defines their own body background-color .
However, since the entire application is compiled into a body tag, it seems that there is a conflict, and only one of the body tags is respected for both routes.
<body> <script src="bundle.js" type="text/javascript"></script> </body>
The reason I want to use the body tag, not just the div container, is because I want the background-color be visible when I view the borders of the page (bounce effect on Mac and iOS).
What is the right way to do this?
source share