react-with-observable icon indicating copy to clipboard operation
react-with-observable copied to clipboard

How to use cache components by key?

Open steveast opened this issue 4 years ago • 4 comments

You can reproduce an issue here Click on text and you get "did mount rx" over and over again, how to fix it?

steveast avatar Dec 24 '20 11:12 steveast

As you can see, the same happens when you're just mapping over the array without rxjs. It is an expected behaviour - when the key prop changes, the component gets unmounted.

typeofweb avatar Dec 24 '20 12:12 typeofweb

As you can see, the same happens when you're just mapping over the array without rxjs. It is an expected behaviour - when the key prop changes, the component gets unmounted.

But in the example it is not that. image

steveast avatar Dec 24 '20 12:12 steveast

Not when I run it:

2BF4DA45-6B35-4B06-BA70-43F9DBFBC748

typeofweb avatar Dec 24 '20 13:12 typeofweb

Not when I run it:

After run, click on text, be attention, please.

steveast avatar Dec 24 '20 13:12 steveast