Is there any package that would allow me to display SVG image loaded from external URL?
I've tried to use react-native-svg-image / react-native-svg-uri and their forks but none of those are working correctly - is there any non dead package for react-native that would do the job?
This is the sample error being thrown by svg-img-uri
<SvgUri width="24" height="24" source={{ uri: 'https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.3.0/flags/1x1/ad.svg' }} />
Text strings must be rendered within a <Text> component.
This error is located at:
in RNSVGDefs (at Defs.js:8)
react-native-svg now supports display svg from online uri
import { SvgUri } from 'react-native-svg';
export default () => (
<SvgUri
width="100%"
height="100%"
uri="http://demo.com/assets/your/image.svg"
/>
);
Reference https://github.com/react-native-svg/react-native-svg#use-with-content-loaded-from-uri
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With