I am not at all an expert in react, but from what I could see if I import some css sheets these will be for all my application. If I wanted to use react for a multi-page app how do I define css sheets for each page?
My file structure
Page 1
import React, { Component } from "react";
import "./style.css";
export default class Page1 extends Component {
render() {
return (
<div>
<button>with css</button>
</div>
);
}
}
Page 2
import React, { Component } from "react";
export default class Page2 extends Component {
render() {
return (
<div>
<button>no css</button>
</div>
);
}
}
style.css
button {
background: green;
}
This style should only be applied to the first page but it is also applied to page 2. How can I solve this?