There is a TS error when trying to access theme.components even though it is definitely there.
Expected behavior
I think components should be part of the Theme type by default, even if it's an optional type - I have to override Theme type for it to work as expected
Steps to reproduce
Link to live example: (required) https://codesandbox.io/p/sandbox/morning-brook-wjkmj4?file=%2Fsrc%2FDemo.tsx
Steps:
components
fromuseTheme
resultCurrent behavior
There is a TS error when trying to access
theme.components
even though it is definitely there.Expected behavior
I think
components
should be part of theTheme
type by default, even if it's an optional type - I have to overrideTheme
type for it to work as expectedContext
No response
Your environment
``` System: OS: macOS 14.4.1 Binaries: Node: 21.6.0 - /usr/local/bin/node npm: 10.2.4 - /usr/local/bin/npm pnpm: 9.0.6 - /usr/local/bin/pnpm Browsers: Chrome: 124.0.6367.207 Edge: 124.0.2478.105 Safari: 17.4.1 npmPackages: @mui/base: 5.0.0-beta.40 => 5.0.0-beta.40 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/system: ^5.15.15 => 5.15.15 @mui/utils: 5.15.14 ```npx @mui/envinfo
Search keywords: mui, joy, theme, components, type