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

Custom control type matchers should support all control types #14654

Open
kylegach opened this issue Apr 19, 2021 · 1 comment
Open

Custom control type matchers should support all control types #14654

kylegach opened this issue Apr 19, 2021 · 1 comment

Comments

@kylegach
Copy link
Contributor

kylegach commented Apr 19, 2021

Is your feature request related to a problem? Please describe

Custom control type matchers are a useful feature, but would be much more useful if they supported all control types, instead of just "color" and "date".

For example, our component library uses lots of props named *Props (e.g. InputProps), as it is built on material-ui. All of those should use the "object" control type, but the inferred type is the default "JSON string".

Describe the solution you'd like

Something like type Matchers = Record<keyof SupportedControlTypes, Regex>, and supporting code.

Describe alternatives you've considered

This is a convenience feature, as consumers can define the control type for each individual prop, currently.

Are you able to assist to bring the feature to reality?

Yep. Happy to submit a PR. Looks like this might be a good starting point, and would consider changes to tests/docs, as well.

Additional context
Add any other context or screenshots about the feature request here.

@kylegach
Copy link
Contributor Author

Being able to specify the equivalent of { control: false } via matchers would be helpful, as well. Use case: *Ref props, e.g. innerRef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants