-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Component created with styled
doesn't contain the component
prop in TS
#44192
Comments
Thanks for reporting @vitorpdasilva. Here's a reproduction https://codesandbox.io/p/sandbox/sad-faraday-ghd8xh?file=/src/Demo.tsx The JS implementation works, but the
<StyledList as="nav"> edit: the |
@vitorpdasilva sorry for my last comment, the |
styled
doesn't contain the component
prop in TS
This is not a new issue, the solution is documented in https://mui.com/material-ui/guides/composition/#with-typescript. It's either this or you cast the newly created component with as typeof Typography (or any other Material UI component). This is likely a duplicate of: #29875 |
Steps to reproduce
Link to live example: (required)
Steps:
<List component="nav">
Current behavior
It throws the error
Expected behavior
dont throw any error.
Context
No response
Your environment
npx @mui/envinfo
Search keywords: list component v6
The text was updated successfully, but these errors were encountered: