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.

Is there a way to disable component recycling?

See original GitHub issue

In my application, I’m using xterm, and I’m mounting it to a referred component on the componentDidMount event. The application can handle several tabs that are looped through .map, and when a tab closes preact tries to reuse the <Terminal /> component, which looks all the same to him(since he just diffs the JSX part without the terminal element I believe, correct me if I’m wrong).

The problem is that every terminal is linked to a shell, and when it tries to reuse the terminal component it reuses the shell too, so closing a tab will then mess up all the related terminals and shells.

My code is public on GitHub if you want to read it or give it a try feel free to do it. A critical part of it could be the willReciveProps event that I’m using to prevent from re-rendering when cols, rows and selection of the terminal updates. Here are the pieces of code: <Terminal /> <Terminals /> (loop)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
nisanthchundurucommented, Aug 9, 2017

@LucaT1 How did you solve it? By passing the key prop when instantiating <Terminal /> components?

0reactions
lucat1commented, Aug 9, 2017

Yeah in fact it worked. Tough i may have named the issue wrongly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to disable component recycling? #776 - GitHub
Using key doesn't disable component recycling. key={Date.now()} for example makes your component be recreated on each re-render. Also "component ...
Read more >
Enable/Disable Component | CloverDX 5.17.0 Documentation
Right click the component and select Disable as Trash from the context menu. A trash icon appears on the component and all subsequent...
Read more >
React Native Listview Disable Recycling - Stack Overflow
So I guess in short, I am wanting to completely reset the listview component when datasource changes or disable the recycling part.
Read more >
Enabling, Disabling, or Recycling the Service
You can enable, disable, or recycle the service from the Administrator tool.
Read more >
The U.S. Recycling System | US EPA
This page provides the basis on the United States recycling system, including recycle benefits, how recycling saves resources and jobs, ...
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