I\'m using React, Material UI with JSS and React Router.
I\'m hooking in to to apply an active class like:
If btn is another class defined via JSS, then you need to refer to it using $btn.
See this part of the JSS documentation.
Here's some sample code that works:
import React from "react";
import ReactDOM from "react-dom";
import { NavLink, BrowserRouter } from "react-router-dom";
import { withStyles } from "@material-ui/core/styles";
const styles = {
btn: {},
active: {
"& $btn": {
backgroundColor: "#2A354F",
color: "#fff"
}
}
};
function App(props) {
return (
);
}
const StyledApp = withStyles(styles)(App);
const rootElement = document.getElementById("root");
ReactDOM.render( , rootElement);