-
Notifications
You must be signed in to change notification settings - Fork 353
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
fix(HorizontalNavMenuItem): Allow HorizontalNavMenuItem's title to be a node #2825
fix(HorizontalNavMenuItem): Allow HorizontalNavMenuItem's title to be a node #2825
Conversation
@@ -35,7 +35,7 @@ const HorizontalNavMenuItem = props => { | |||
HorizontalNavMenuItem.propTypes = { | |||
children: PropTypes.node, | |||
onItemClick: PropTypes.object, | |||
title: PropTypes.string, | |||
title: PropTypes.node, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While node works for both, we typically have used:
title: PropTypes.node, | |
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), |
to be more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that it's required node can be anything that can be rendered https://reactjs.org/docs/typechecking-with-proptypes.html#proptypes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, just looking for consistency and explicitly noting in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guys, I do not care ;-)
I am seeing both variants in places. Tell me if I need to change it to get the PR merged or not.
Yes - change / No - leave it.
That's what I care about :-D Because w/o that I cannot finish the PRs above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx!
@martinpovolny Could you rebase your branch to fix the build error? |
82bba76
270089f
to
82bba76
Compare
Rebased. |
PatternFly-React preview: https://patternfly-react-pr-2825.surge.sh |
Your changes have been released in:
Thanks for your contribution! 🎉 |
Allow HorizontalNavMenuItem's title to be a node rather than just a string.
Needed by: ManageIQ/react-ui-components#115 and ManageIQ/manageiq-ui-classic#5997
Ping @karelhala