Question: How to destroy/teardown
See original GitHub issueIn a React environment, imagine this:
- Component is mounted, xcomponent is then set up, iframe loaded, event listeners attached etc
- The component is unmounted (because we no longer want to show the xcomponent)
- Component is mounted again. Now we’re getting the error:
Request listener already exists for xcomponent_delegate_mystuff on domain * for specified window
I’m enclosing the xcomponent supplied react component in my own component so I can do stuff on componentWillUnmount
, but how to tear down the correct way? I’ve searched the source code but didn’t find any obvious reasons.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Any possibilities we can break the unbreakable?
Teardown. Any possibilities we can break the unbreakable? Mainly a question towards the dev but will we ever get the ability to destroy...
Read more >angular rxjs subscription teardown
You don't need to call complete() if you're using destroy$ only for takeUntil() operators. When destroy$ emits next takeUntil() will ...
Read more >Teardown Questions : r/TeardownGame
Teardown can damage your GPU or system in some way and I just wanna know if this is true or not. Teardown is...
Read more >What Does It Mean to Tear Down a Statue?
The current attacks on statues are a sign that what's in question is not just our future but our past, I think, as...
Read more >How to handle tearDown of JUnit tests (in Gradle) when ...
I have a question about how to handle tearDown of JUnit tests (in Gradle) when you have multiple ... in that case the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I didn’t get that. Thanks for clarifying that for me.
I guess I should clarify this in the docs.
let SomeXComponent = xcomponent.create()
is analogous to React’slet SomeReactComponent = react.createClass()
(which you’d normally only call once per component you want to create)SomeXComponent.render()
is analogous to callingSomeReactComponent.render()
in React, or dropping a<SomeReactComponent />
into a jsx template during a render.I’ll wait to make sure I’m not missing something about what you’re trying to do @emiloberg, otherwise I’ll close this issue.