You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, I'm trying to show SVG images from s3 public bucket. No headers required or anything. I want to try to show them with react-native-fast-image because when I use react-native-SVG there is a huge performance issue on android. I have proximately 10-12 SVG images per screen and sometimes it takes 1-2 seconds to load them.
What I'm trying with react-native-fast-image is :
import React, { useRef } from 'react';
import { View } from 'react-native';
import {
Svg,
G,
Circle,
Defs,
LinearGradient,
Mask,
Rect,
Stop,
} from 'react-native-svg';
import FastImage from 'react-native-fast-image';
Hey guys, I'm trying to show SVG images from s3 public bucket. No headers required or anything. I want to try to show them with react-native-fast-image because when I use react-native-SVG there is a huge performance issue on android. I have proximately 10-12 SVG images per screen and sometimes it takes 1-2 seconds to load them.
What I'm trying with react-native-fast-image is :
import React, { useRef } from 'react';
import { View } from 'react-native';
import {
Svg,
G,
Circle,
Defs,
LinearGradient,
Mask,
Rect,
Stop,
} from 'react-native-svg';
import FastImage from 'react-native-fast-image';
const YourImage = (props) => (
<FastImage
// eslint-disable-next-line react/prop-types
onLoad={props.onLoad}
style={{ width: props.svgSilkWidth, height: props.svgSilkHeight }}
source={{
uri: props.silkUrl,
priority: FastImage.priority.normal,
cache: FastImage.cacheControl.web,
}}
resizeMode={FastImage.resizeMode.contain}
/>
);
// eslint-disable-next-line react/display-name
export default (silkUrl) => {
const svg = useRef(null);
return (
<View style={{ flex: 1, justifyContent: 'center' }}>
<YourImage
silkUrl={silkUrl.silkUrl}
svgSilkWidth={silkUrl.svgSilkWidth}
svgSilkHeight={silkUrl.svgSilkHeight}
onLoad={() => {
svg?.current?.forceUpdate?.();
}}
/>
};
But nothing is showing. I did try to get an SVG URL from google just to try still not showing. All other formats like png, jpeg and etc are working.
Can I get a hand with that pleases?
Thanks!
The text was updated successfully, but these errors were encountered: