Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native FastImage not Loading Properly on 5G Network #1046

Open
parthshiroya6 opened this issue Aug 30, 2024 · 0 comments
Open

React Native FastImage not Loading Properly on 5G Network #1046

parthshiroya6 opened this issue Aug 30, 2024 · 0 comments
Labels

Comments

@parthshiroya6
Copy link

I'm having an issue with image loading in my React Native app using react-native-fast-image. My images are loading very slowly, even on a 5G network, especially when I try to load new images multiple times. I’ve implemented preloading, but it doesn’t seem to improve the situation.

React-Native version:0.70.0
react-native-fast-image:^8.6.3

Please check below video for issue :-

Screen.Recording.2024-08-30.at.11.44.05.AM.mov
import React, { useEffect } from "react";
import { Dimensions, Image, ImageStyle, StyleProp } from "react-native";
import Assets from "../constants/Assets";
import FastImage from "react-native-fast-image";
import ShimmerImage from "./ShimmerImage";
import ImageZoom from "react-native-image-pan-zoom";

interface Props {
  imgStyle: StyleProp<ImageStyle> | undefined;
  uri: string | null;
  thumbnailUrl: string | null;
  isZoomable?: boolean;
}

const ImageSlider = ({ imgStyle, uri, thumbnailUrl, isZoomable }: Props) => {
  let checkImageURL = uri
    ? {
        uri: uri,
        headers: { Authorization: "someAuthToken" },
        priority: FastImage.priority.high,
      }
    : Assets.placeholder;
  useEffect(() => {
    if (uri) {
      FastImage.preload([{ uri }]); // Preload the image when URI changes
    }
  }, [uri]);

  return (
    <FastImage
      style={[imgStyle]}
      source={checkImageURL}
      resizeMode={FastImage.resizeMode.cover}
      fallback={true}
    />
  );
};

export default ImageSlider;

I want to solve this issue as below link

Screen.Recording.2024-08-30.at.11.24.04.AM.mov

if anyone know to any solution please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant