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

The component props should be any type #47

Closed
zxy-c opened this issue Jan 15, 2021 · 5 comments
Closed

The component props should be any type #47

zxy-c opened this issue Jan 15, 2021 · 5 comments

Comments

@zxy-c
Copy link
Contributor

zxy-c commented Jan 15, 2021

Such as component prop for button
https://material-ui.com/zh/api/button-base/

@cfnz
Copy link
Owner

cfnz commented Jan 15, 2021

component should be a string or a component. A component gets a bit more complicated trying to define its type, so I went with the more typesafe, but not correct in every use case, String rather than making it an open Any type or trying to define the proper typesafe type.

Do you have a use case where you need it to be some type of component rather than an html component (i.e. string)?

@zxy-c
Copy link
Contributor Author

zxy-c commented Jan 16, 2021

@cfnz
Copy link
Owner

cfnz commented Jan 19, 2021

Yip, that is a good use case... I shall think about it...

@cfnz
Copy link
Owner

cfnz commented Mar 6, 2021

This was changed some time ago for buttons and typography... shall leave it open for now as component prop is used in lots of different components.

@cfnz
Copy link
Owner

cfnz commented Jan 21, 2022

Closing for now, new use cases can be added as needed.

@cfnz cfnz closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants