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

Unable to pass an Icon to backButtonComponent #115

Open
ericraio opened this issue Apr 15, 2016 · 2 comments
Open

Unable to pass an Icon to backButtonComponent #115

ericraio opened this issue Apr 15, 2016 · 2 comments

Comments

@ericraio
Copy link
Contributor

When I was setting the back button component, I couldn't just pass in an Icon component, the proptype is expecting a function and not an object. I had to create a new component that returns the Icon and pass it in.

Should we change this?

@davidLeonardi
Copy link
Contributor

As the name of the prop says, it expects a component, which is a function and not an object. I don't see why we should change the usecase for this specific property, as it is semantically correct.
If you'd like to introduce a new prop for defining an icon, you're welcome to do that, but generically supporting icons is a slippery slope in my opinion, because there are quite a few ways of doing that. For instance in my project I use custom fonts for icons. But I've also used image sprites before.
The implementations may vary vastly, and it's difficult to find a general solution, so I think it might be wise to leave it to the implementor to quickly write a dumb component to display an icon.

I vote no.

@ericraio
Copy link
Contributor Author

ericraio commented Apr 15, 2016

@SEthX
I think it should take any react element, this would support all components, images, icons. anything that renders

React.PropTypes.func -> React.PropTypes.element,

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