Skip to content

Async image preparation before setting FastImage source #383

@nexquery

Description

@nexquery

Problem Statement

Hi 👋

I’m using react-native-fast-image and I need to prepare an image asynchronously before rendering it.

In my screen flow, I run multiple async operations and only want to render the screen after verifying that the image URL is reachable.

Example:

const getImage = async (url: string) => {
  await axios.head(url);
  return { uri: url };
};

const image = await getImage(URL);

<FastImage source={image} />

Is this the recommended approach, or is there a better way to handle async image validation / preparation before passing the source prop?

Thanks!

Proposed Solution

No response

Alternatives Considered

No response

Additional context

No response

Affected Platforms

Android

Priority

Medium (would be a nice addition)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions