Theme inheritance (nesting) not working for Typography but working fine for color palette #44033
Labels
component: Typography
The React component.
customization: theme
Centered around the theming features
support: Stack Overflow
Please ask the community on Stack Overflow
Steps to reproduce
Link to live example: https://codesandbox.io/p/sandbox/y8crhq?file=%2Fsrc%2Fcomponents%2FChild.tsx%3A20%2C50
Steps:
Current behavior
When we modify the inherited theme, the palette colors work but none of the Typography changes work.
Expected behavior
Typography
fontFamily
andfontSize
etc should also be updated for the child components.I don’t want to call
createTheme()
again but instead the<ThemeProvider<Theme> theme={(parentTheme) => ({...parentTheme})}>
method should work properly.Context
App.tsx
Parent.tsx
Child.tsx
Some references from the docs:
https://mui.com/material-ui/customization/theming/#nesting-the-theme
https://mui.com/system/styles/advanced/#theme-nesting
Your environment
npx @mui/envinfo
Search keywords: theme-inheritance theme-nesting
The text was updated successfully, but these errors were encountered: