Skip to content

WebComponents now requires class syntax #8656

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

Closed
rektide opened this issue Dec 30, 2016 · 1 comment
Closed

WebComponents now requires class syntax #8656

rektide opened this issue Dec 30, 2016 · 1 comment

Comments

@rektide
Copy link

rektide commented Dec 30, 2016

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Modern browsers no longer permit Object.create(HTMLElement.prototype) as a means of creating Web Components. See:

It's not possible to use custom elements without ES6 classes.

WebComponent demo uses this now-removed means of creating WebComponents.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).

Running the linked webcomponent demo will throw an Uncaught TypeError.

What is the expected behavior?

The demo executes & renders.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

I'm not sure when this change went into force in browsers. Chrome m55 that I'm on is broken. m54 was broken.

rektide added a commit to rektide/react that referenced this issue Dec 30, 2016
This is a straightforward update of the WebComponent example to match the final 1.0 specification. To meet 1.0 spec, class syntax must be used.
I'm unsure of any paths forward to maintaing support for old browsers while also supporting new ones, short of feature detection & having two codepaths.
@gaearon
Copy link
Collaborator

gaearon commented Oct 4, 2017

Fixed in docs.

@gaearon gaearon closed this as completed Oct 4, 2017
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