question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How to destroy/teardown

See original GitHub issue

In a React environment, imagine this:

  1. Component is mounted, xcomponent is then set up, iframe loaded, event listeners attached etc
  2. The component is unmounted (because we no longer want to show the xcomponent)
  3. 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:closed
  • Created 6 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
raphaelcostacommented, Apr 8, 2017

Yes, I didn’t get that. Thanks for clarifying that for me.

0reactions
bluepnumecommented, Apr 8, 2017

I guess I should clarify this in the docs.

  • let SomeXComponent = xcomponent.create() is analogous to React’s let SomeReactComponent = react.createClass() (which you’d normally only call once per component you want to create)
  • SomeXComponent.render() is analogous to calling SomeReactComponent.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found