Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@mui/joy] components is not in Theme type #42245

Open
Onurfesci opened this issue May 15, 2024 · 0 comments
Open

[@mui/joy] components is not in Theme type #42245

Onurfesci opened this issue May 15, 2024 · 0 comments
Assignees
Labels
package: joy-ui Specific to @mui/joy status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript

Comments

@Onurfesci
Copy link

Onurfesci commented May 15, 2024

Steps to reproduce

Link to live example: (required)
https://codesandbox.io/p/sandbox/morning-brook-wjkmj4?file=%2Fsrc%2FDemo.tsx

Steps:

  1. Try to use components from useTheme result
  2. TS Error

Current behavior

There is a TS error when trying to access theme.components even though it is definitely there.
image

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

Context

No response

Your environment

npx @mui/envinfo

  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 

Search keywords: mui, joy, theme, components, type

@Onurfesci Onurfesci added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 15, 2024
@mnajdova mnajdova added typescript package: joy-ui Specific to @mui/joy labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: joy-ui Specific to @mui/joy status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript
Projects
None yet
Development

No branches or pull requests

3 participants