SxProps doesn't exist in @mui/material/styles
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
when you type
import { SxProps, Theme } from '@mui/material/styles';
The Typescript linter complains:
Module '"@mui/material/styles"' has no exported member 'SxProps'.
This is happening in the new version @mui/material v5.2.4
Expected behavior 🤔
To SxProps
to exists in package @mui/material/styles
as it’s told in the official documentation:
https://mui.com/system/the-sx-prop/#passing-sx-prop
Steps to reproduce 🕹
Steps:
- Install latest
@mui/material
- type
import { SxProps, Theme } from '@mui/material/styles';
- check errors with the TS linter in VSC
Context 🔦
I was trying to pass the sx props as recommended in the documentation
Your environment 🌎
`npx @mui/envinfo`
Don't forget to mention which browser you used.
Output from `npx @mui/envinfo` goes here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
SxProps doesn't exist in @mui/material/styles #30229 - GitHub
The Typescript linter complains: Module '"@mui/material/styles"' has no exported member 'SxProps'. This is happening in the new version ...
Read more >The sx prop - MUI System
The sx prop is a shortcut for defining custom styles that has access to the theme. The sx prop lets you work with...
Read more >MUI TextField sx props does not apply styles - Stack Overflow
I'm using MUI v5. If I inspect the input element, the styles are not applied. What am I missing? UPDATE: it seems the...
Read more >The `sx` Prop - Theme UI
The sx prop lets you add any valid CSS to an element, while using values from your theme to keep styles consistent. You...
Read more >How to use the sx prop in MUI v5. Still using makeStyles?
How can we fix this using MUI styling? makeStyles and useStyles hooks in v4. Material UI v4 has multiple ways to style components...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doing some inspection, I found that
SxProps
is in package@mui/system
, so either you move an export to@mui/styles
or change the documentation, because somehow the TS linter is crashing and complaining.I am closing as there was no reproduction provided. If you have a new one, please re-open the issue and add a link to repository.