我对Material UI还比较陌生,现在我想设置一个像这样的Typography
文本颜色:
const theme = createMuiTheme({
palette: {
text:{
primary: "#FFFFFF"
}
}
});
const WhiteText = (props: { text:string, varient: Variant | 'inherit'}) => {
return <ThemeProvider theme={theme}>
<Typography variant={props.varient} align="center" color="textPrimary">{props.text}</Typography>
</ThemeProvider>
}
...
<WhiteText varient="h3" text="This text should be white"/>
但文本颜色没有变化 :/
我是不是错误地应用了主题?