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

Keep "special" properties out of getDefaultProps #34

Open
job13er opened this issue Jan 10, 2017 · 0 comments
Open

Keep "special" properties out of getDefaultProps #34

job13er opened this issue Jan 10, 2017 · 0 comments

Comments

@job13er
Copy link
Contributor

job13er commented Jan 10, 2017

From a slack conversation:

FYI: Don’t put classNames in your getDefaultProps() of your component. It apparently breaks event bindings on the component itself (not it’s children) i.e. when you define a click() method or an Ember.on('click') for the component itself. I haven’t quite figured out why that is, and I’ve hit my limit of wanting to dig through ember innards today (2 hours was my max). For now, at least, I think we should not put the “special ember properties” in getDefaultProps() i.e. classNames tagName, classNameBindings, attributeBindings. I propose we put those above propTypes in our component definitions.

There are other reasons as well to avoid this. The concatenatedProperties functionality becomes broken when you use getDefaultProps() to set things like classNameBindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant