Skip to content

Preload images for speed optimizationΒ #212

@yerzhan-karatay

Description

@yerzhan-karatay

Hi there!
Why do the images render every time the ImageViewing is visible, even if they've already been rendered? When a user closes and reopens ImageViewing, it loads the images from scratch without caching.
How can I preload the images and then load them from the cache so I don't see the loader spinner all the time?

import ImageViewing from 'react-native-image-viewing';
...
<ImageViewing
        images={images}
        imageIndex={viewImageIndex ?? 0}
        key={item.uuid}
        visible={viewImageIndex !== null}
        onRequestClose={() => {
          setViewImageIndex(null);
        }}
      />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions