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

fix(HorizontalNavMenuItem): Allow HorizontalNavMenuItem's title to be a node #2825

Merged

Conversation

martinpovolny
Copy link
Contributor

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

karelhala
karelhala previously approved these changes Sep 4, 2019
@@ -35,7 +35,7 @@ const HorizontalNavMenuItem = props => {
HorizontalNavMenuItem.propTypes = {
children: PropTypes.node,
onItemClick: PropTypes.object,
title: PropTypes.string,
title: PropTypes.node,
Copy link
Member

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:

Suggested change
title: PropTypes.node,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),

to be more explicit

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

skateman
skateman previously approved these changes Sep 6, 2019
@jeff-phillips-18
Copy link
Member

@martinpovolny Could you rebase your branch to fix the build error?

@martinpovolny
Copy link
Contributor Author

Rebased.

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://patternfly-react-pr-2825.surge.sh

@jeff-phillips-18 jeff-phillips-18 merged commit 78adfa4 into patternfly:master Sep 9, 2019
@patternfly-build
Copy link
Contributor

Your changes have been released in:

Thanks for your contribution! 🎉

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

Successfully merging this pull request may close these issues.

5 participants