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

how to unregister a custom element #1294

Closed
mohamedafzal03 opened this issue Jan 22, 2021 · 2 comments
Closed

how to unregister a custom element #1294

mohamedafzal03 opened this issue Jan 22, 2021 · 2 comments

Comments

@mohamedafzal03
Copy link

Origin page
HI
to register a custom element, window.customElements.define('my-custom-element', MyCustomElement);
I want to unregister a custom element , is there any possibilities?
like(window.customElements.undefine('my-custom-element')
will be helpful if u guys share your insights.

@jogibear9988
Copy link

this is not possible at the moment.
maybe this would help in the future: https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry

If you'd like to replace a registered component, you could register a proxy wich then later could replace the implementation.

@justinfagnani
Copy link
Collaborator

This is a spec question. It's currently impossible to unregister an element (and there are questions about what that would mean). You can see the spec issue here: WICG/webcomponents#754

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

3 participants