react-polymer icon indicating copy to clipboard operation
react-polymer copied to clipboard

Do we still need it with react 16?

Open MOZGIII opened this issue 8 years ago • 2 comments

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

MOZGIII avatar Sep 27 '17 19:09 MOZGIII

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.

jscissr avatar Sep 27 '17 20:09 jscissr

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?

MOZGIII avatar Sep 27 '17 20:09 MOZGIII