Search code examples
javascriptreactjspolymerweb-componentreact-dom

Polymer 1.x and React


I am currently trying to integrate some webcomponent built using Polymer v1 inside our app built using the latest React version (16.3.2 as I'm writing).

On all major browsers the integration works fine (Chrome, Edge, Firefox). On Safari, however, I keep getting this error:

TypeError: undefined is not an object (evaluating 'descriptor.get')

This error is fired by the react-dom.development.js script (it also happens with the production build).

My gut feeling is that somehow as soon as Polymer is loaded and starts interacting with the dom, it overwrites or somehow overlaps whatever React is doing, but I really couldn't find where or how this happens, nor a suitable workaround.

Can anybody provide more insight on why this is happening, or where to look for a solution?

Many thanks!

Versions used:

  • Polymer 1.x (all components are updated to the latest 1.x version)
  • React 16.3.2
  • webcomponents-lite.min.js 0.7.24 (latest version compatible with Polymer 1.x)

Solution

  • There was some weird conflict between Polymer components which extends standard HTML elements and ReactDOM.

    ReactDOM recently got an update reaching the version 16.4.0, this seems to fix some bad behaviour especially with custom components and third-party libraries.

    Reproducing your environment and performing the updates, the issue seems to be fixed.