-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Ability to exclude some chained prop types #10371
Comments
Sort of dupe to #7943 |
@shilman As I can see, the issue is still opened which means that there is still no support for this feature ? If that is the case, in which version we should expect this feature to be available ? |
@mustran Either 6.0, which should be stable by mid-May, or 6.1, which should be stable mid-Summer. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
A workaround I've added is the ability to specify props type PropDescriptor = string[] | RegExp;
interface BaseProps {
include?: PropDescriptor;
exclude?: PropDescriptor;
} So you could achieve what you want by only including non-chained props. E.g.: const include = ['buttonModifiers', 'sizeType', 'style', 'className', 'fullWidth', 'fullHeight'];
<Props of={Button} include={include} />; |
Hi @shilman. Thank you a lot for your answer, it looks amazing. |
@shilman I deleted Also, this is how my and in the dependencies I have |
Disabling via Disabling via |
Is your feature request related to a problem? Please describe.
I am trying to generate docs for a library and suddenly I got into a problem where I can't exclude some inherited types (props) from TypeScript.
TypeScript types:
Button Component:
Describe the solution you'd like
I want to be able to remove the props from
HTMLButtonElement
so it shows only theContentProps
and the other defined props (buttonModifiers
,sizeType
etc).Describe alternatives you've considered
None.
Are you able to assist bring the feature to reality?
maybe ..
Screenshot
The text was updated successfully, but these errors were encountered: