I've been experiencing an issue in which I cannot apply 'color' inside the 'sx' property of a Typography component. Does anyone know what might be causing the issue?
Removing the 'color' key causes the color of the 2 line to be reverted to default (same as the 1st line).
import React from 'react';
import {Box, createTheme, CssBaseline, Typography} from '@mui/material';
import {ThemeProvider} from '@mui/styles';
const theme = createTheme({
palette: {
mode: 'dark',
},
});
console.log(theme);
function App() {
return (
<ThemeProvider theme={theme}>
<CssBaseline />
<Box
sx={{
height: '100%',
bgcolor: 'background.paper',
color: 'text.primary',
}}>
1111111111111111
<Typography sx={{color: 'text.secondary'}}>
22222222222222222
</Typography>
<Box sx={{color: 'text.secondary'}}>333333333333</Box>
</Box>
</ThemeProvider>
);
}
export default App;

