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

Added element as a prop type for the label prop #1095

Merged

Conversation

iKonrad
Copy link
Contributor

@iKonrad iKonrad commented Jun 26, 2018

Hi, for the custom input field, when I pass a react element as a label it throws a validation error from PropTypes.

With this solution I can't pass a I agree to <a>Terms and conditions</a> element because it's rendering as a text.

I think Custom Input should accept either text or element as labels.

@@ -7,7 +7,7 @@ const propTypes = {
className: PropTypes.string,
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
type: PropTypes.string.isRequired,
label: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
Copy link
Member

Choose a reason for hiding this comment

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

probably just want PropTypes.node which is defined as:

Anything that can be rendered: numbers, strings, elements or an array (or fragment) containing these types.

@TheSharpieOne TheSharpieOne merged commit c1374b4 into reactstrap:master Jul 17, 2018
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.

None yet

2 participants