software-mansion / react-freeze

Prevent React component subtrees from rendering.
MIT License
1.55k stars 34 forks source link

Freeze snapshot #9

Open ethanshar opened 2 years ago

ethanshar commented 2 years ago

It would have been great if freezing a component will generate some sort of a non-reactive snapshot that can be displayed instead of returning null. That would great with showing temporarily blanks screens/components till they get unfreeze

nandorojo commented 2 years ago

Not sure if this is possible, but it would be awesome.

One (hack) idea could be to use react-native-view-shot to capture an image onBlur, and render that as the fallback.

niraj-khatiwada commented 2 years ago

It would have been great if freezing a component will generate some sort of a non-reactive snapshot that can be displayed instead of returning null. That would great with showing temporarily blanks screens/components till they get unfreeze

I was under the impression that this library was for this thing. I got my hopes high. But anyway, it would be great if we could display the snapshot until the interaction manager is complete. This would be game changer specially for Android.

JustMaier commented 1 year ago

We dealt with this by capturing the innerHTML of the node we planned to freeze before freezing and using that as the placeholder. Seemed to work.

saxenanickk commented 1 month ago

Anyone did this with the react-native?