Seeking to segregate styling from component File in MUI v5. In the past, I accomplished this in v4 by utilizing makeStyles
as shown below:
Page.style.js
:
import { makeStyles } from "@material-ui/core";
export const useStyles = makeStyles({
root: {
background: "white",
},
});
Page.js
:
import React from "react";
import useStyles from "./Page.style";
const Page = () => {
const classes = useStyles();
return (
<div className={classes.root}></div>
)
}
makeStyles
is now considered legacy and slated for deprecation in future versions.
What is the recommended approach for separating styling and components into distinct files in v5?