I’ve tried all the common packages. Nothing seems to work. Has anyone been able to load a remote svg with expo web?
Found a solution:
import React from 'react';
import { Image, Platform } from 'react-native';
const SvgImage = props => {
var SvgUri;
if (Platform.OS === 'web'){
return <Image style={props.style} source={{uri: props.uri}} />
}else{
SvgUri = require('expo-svg-uri');
return <SvgUri width={props.style.width} height={props.style.height} source={{uri: props.uri}} />
}
}
export default SvgImage;
1 Like
Glad you got it figured out!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.