I am currently working on developing a Single Page Application using ReactJS. However, I am facing an issue with styling. Currently, I have created 3 different pages (with the intention of adding more in the future), each having its own CSS file that is imported as follows:
*index.jsx
import index form './index.css'*
*page2.jsx
import page3 form './index.css'*
*page3.jsx
import page3 form './index.css'*
When I initially open the site in the browser and navigate to the (index) page, everything appears fine. But when I proceed to the next page (page2), then click back and return to the (index) page, the styles are changed. This is happening because some classes have the same name in both CSS files, and the second CSS file loaded (page2.css) is overriding the (index.css). How can I resolve this issue?
Apologies if my question is not very clear.
Thank you!