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

Typechecking on "as" prop for Button Component should also expect an elementType #4893

Closed
1 of 2 tasks
t-soares opened this issue Dec 16, 2019 · 0 comments · Fixed by #4895
Closed
1 of 2 tasks

Typechecking on "as" prop for Button Component should also expect an elementType #4893

t-soares opened this issue Dec 16, 2019 · 0 comments · Fixed by #4895

Comments

@t-soares
Copy link
Contributor

t-soares commented Dec 16, 2019

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Passing the Link component from react-router-dom to as prop of Button component, print a warning on Browser console.

Warning: Failed prop type: Invalid prop as supplied to ForwardRef(Button).

Typechecking on "as" prop for Button Component should also expect a elementType.
Currently if as prop can be only a function or a string.
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),

What browser are you working in?
Chrome
What version of the Carbon Design System are you using?
10

Add labels

component: button
label:"component: button"

@t-soares t-soares changed the title Typechecking on "as" prop for Button Component should also expect a elementType Typechecking on "as" prop for Button Component should also expect an elementType Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants