Floribunda Rose Tree: Vibrant & Versatile
StContainer-class is not considered good practice to instantiate stylable effects inside a Component's render method.
Stylable effects should generally be instantiated once per Component. If you find yourself needing to change the styling based on react state, consider using a higher order component or react context api. Here's how you can change the styling of a Component using withStyles:
Instead, use withStyles to create a styled component:
(MyComponent's markup here)
);
const styles = (theme) => ({
root: {
padding: theme.spacing(1),
backgroundColor: theme.palette.background.paper,
},
});
export default withStyles(styles)(MyComponent);