Load/unload Animated.Image based on shared value #2829
Unanswered
maxaggedon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a component which allows the user to pan and zoom across a large image grid.
Transforms run smoothly but I had to introduce some kind of virtualization in order to make it work with potentially 1000+ images. So I can easily access the viewport coordinates (and therefore which images are visible) in worklets, but I need to put it in a state so that I can mount/unmount them to free memory and reduce layout computations.
So I have something like this :
In order to reduce JS calls to a minimum, I only update viewport TILE coordinates. It only fires when an image enters or leaves the screen, but it is clearly not perfect... hence the question !
Is it possible to make images outside the viewport costless in terms of performance without unmounting them from the react tree ?
(@wcandillon maybe I should have phrased it can it be done ? 😉)
Beta Was this translation helpful? Give feedback.
All reactions