-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Typescript: "component" prop does not appear in type suggestion #33799
Comments
Also addresses #33710 |
It doesn't look like this bug report has enough info for one of us to reproduce it. Please provide a CodeSandbox (https://material-ui.com/r/issue-template-latest), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve |
Hi @mnajdova, I have also updated the Approaches to fix the bug -
|
It's not missing, see #33710 (comment) Please share codesandbox with a reproduction if this is not the case. |
If I type Codesandbox - example
Although the |
@pratikkarad I bumped into this today. Because of how types are written, TS does not gives you autocompletion for I mean, this code does not report any type error, so TS knows about
if you click through "helpers types" from MenuItem definition you'll end up in OverridableComponent, and this is where material-ui/packages/mui-material/src/OverridableComponent.d.ts Lines 15 to 22 in dfc0b89
exact path is: MenuItem -> ExtendButtonBase -> OverridableComponent |
I don't think we can do anything with the autocomplete because of how we use the |
Duplicates
Latest version
Current behavior 😯
The following components are missing the "component" prop in Typescript documentation, in @mui/material v5.9.3.
As per my initial research, I think the component prop will not be shown in Typescript documentation for any component that has inherited the
ExtendButtonBase
type.Expected behavior 🤔
The component prop should be present in typescript documentation, as it says it exists in the documentation
Steps to reproduce 🕹
component
in Button propCtrl + space
to get suggestions from typescriptcomponent
prop is missing from the documentationContext 🔦
We are using MUI as a base for a component library with different designs and icons. We observed that the component prop in typescript documentation was missing but was present on the official website documentation.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: