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

Do we still need it with react 16? #24

Open
MOZGIII opened this issue Sep 27, 2017 · 2 comments
Open

Do we still need it with react 16? #24

MOZGIII opened this issue Sep 27, 2017 · 2 comments

Comments

@MOZGIII
Copy link

MOZGIII commented Sep 27, 2017

React 16 added proper support for custom props, so do we still have issues with polymer components?

@jscissr
Copy link
Owner

jscissr commented Sep 27, 2017

Yes, custom props is only one problem solved by react-polymer. The others are:

  • custom events
  • using className instead of class, like with other React DOM elements
  • <PolymerElem foo={false} /> should mean omit the foo attribute, instead of setting it to the string 'false'

However, since React 16 is bundled into one file, it looks like it is no longer possible to do the monkey patching that react-polymer does to make these things work. Maybe the only way to make it work is with a custom build of React. But this would mean a lot more maintenance effort, because I would have to release a new react-polymer version for every React release, instead of just major React releases.

@MOZGIII
Copy link
Author

MOZGIII commented Sep 27, 2017

I see. Maybe support for it can be just added to react itself then?
I may be not understanding the situation completely, but className is not that important (is there something that relies heavily on className and would work with shadow-dom-based components? otherwise it's just for consistency, may not be worth the efforts). Ommitting the attribue when props is set to false would also be useful, but it can be dealt with.
Custom events are problematic though, I think you have to make a react wrapper for every polymer component that uses events to bind to them from react, right? Maybe we could just implemnt HOC for it, or sth?

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