react - Difference between createMuiTheme and createTheme
·
Answer a question
As the title says. Both accept same kind of ThemeOptions object.
const theme = createMuiTheme({
palette: {
primary: {
main: "#006400"
},
secondary: {
main: "#ffa500"
}
}
});
const theme = createTheme({
palette: {
primary: {
main: "#006400"
},
secondary: {
main: "#ffa500"
}
}
});
Is createMuiTheme() only for applying styles to Mui components, and not my custom components?
If I want to create custom CSS classes, should I use makeStyles() instead?
Answers
createTheme is the newer name, createMuiTheme is deprecated https://github.com/elyra-ai/elyra/pull/1885. You are correct createTheme() is used to apply different default styles to the Mui components
makeStyles() is a good way to make custom css classes for your new components or the Mui components.
更多推荐
所有评论(0)