gkjohnson / react-polymer-component

A generic React.Component for wrapping Polymer Elements and binding events and property data between them
MIT License
2 stars 4 forks source link

Added behavior and classes support. #11

Closed MichaelKovalchuk closed 5 years ago

MichaelKovalchuk commented 5 years ago

CustomElement doesn't store behavior properties. I had to access this.element to retrieve them Added classes support.

gkjohnson commented 5 years ago

Hey! Thanks for contributing! This is a good find -- I added a few comments.

gkjohnson commented 5 years ago

Great! Thanks for the changes. Last two things:

Other than that this looks good!

MichaelKovalchuk commented 5 years ago

ping @gkjohnson. Is there anything else you want me to add?

gkjohnson commented 5 years ago

@MichaelKovalchuk Sorry I've been less available for the last week! I added one more comment but other than that this looks ready to go. Once the className concern is resolved I'll get this merged!

Thanks again!

gkjohnson commented 5 years ago

@MichaelKovalchuk looks like the tests are failing -- maybe call removeAttribute if className is falsey so the attribute is removed entirely or we could update the tests to check if the class value is falsey (I think I prefer removing it)

MichaelKovalchuk commented 5 years ago

I added condition to add/remove class attribute based on the className prop. The tests should pass now.

gkjohnson commented 5 years ago

Thanks! I'll get it pushed to npm soon