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

Relaxing emptyLabel's PropType requirements #292

Closed
clayjonesthomas opened this issue Jan 20, 2018 · 4 comments
Closed

Relaxing emptyLabel's PropType requirements #292

clayjonesthomas opened this issue Jan 20, 2018 · 4 comments

Comments

@clayjonesthomas
Copy link

It appears that giving emptyLabel a React component renders that component just fine. I didn't look too far into the reasoning behind why emptyLabel is required to be a string, but I believe React components should be allowed as well. Is there another way to give emptyLabel React components that I am missing, or a reason why React components are not accepted?

For convenience, the line with the PropType.

@ericgio
Copy link
Owner

ericgio commented Jan 21, 2018

No good reason other than a string seemed like the most likely use case and I hadn't encountered a need for more. I don't see why a component shouldn't be allowed.

@ericgio
Copy link
Owner

ericgio commented Jan 21, 2018

For clarification, passing a component to emptyLabel now works just fine; the only issue is a React warning. This is only in developer warning, however, and shouldn't show up in production or have any other effects on how the component behaves.

@ericgio
Copy link
Owner

ericgio commented Jan 21, 2018

Should probably just be

emptyLabel: PropTypes.node,

@ericgio
Copy link
Owner

ericgio commented Jan 25, 2018

This should be resolved as of v2.3.0

@ericgio ericgio closed this as completed Jan 25, 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

No branches or pull requests

2 participants