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

Bug - [NavItem] - [invalid TS type for the component prop] #9492

Closed
Hyperkid123 opened this issue Aug 14, 2023 · 2 comments · Fixed by #9579
Closed

Bug - [NavItem] - [invalid TS type for the component prop] #9492

Hyperkid123 opened this issue Aug 14, 2023 · 2 comments · Fixed by #9579
Assignees
Milestone

Comments

@Hyperkid123
Copy link
Contributor

Describe the problem
The NavItem component has the component prop defined as a ReactNode but then uses it in the code as React.ComponentType

How do you reproduce the problem?
Use the NavItem component prop in any TS project with a custom react component (not a or a div).

Expected behavior
The component prop type should be React.ComponentType

Is this issue blocking you?
Many workarounds:

  • typecastring
  • ignoring the type check error
  • redefining the module

What is your product and what release date are you targeting?
HCC, pf5 adoption starting Aug 21st, not blocking

@wise-king-sullyman
Copy link
Contributor

The first part of this issue should be determining if this would be a breaking change. If so we will need to delay this fix until the next major release.

@Hyperkid123
Copy link
Contributor Author

I don't think so, I think we just want to fix the type. Because the component prop is already used as React.ComponentType. You can't pass ReactNode to the prop. You will hit a runtime error.

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

Successfully merging a pull request may close this issue.

3 participants