我试图使用.svg映像,但是当我在组件中呈现它时,我会得到以下错误:
试图导入错误:‘react本机-SvgUri’不包含默认导出(导入为'SvgUri')。
我的代码:
import SvgUri from 'react-native-svg-uri';
const screenBg=require('../../src/assets /logo.svg');
<View style = {stylesLoginScreen.logoContainer}>
<SvgUri source = {screenBg}
width = '100'
height = '100'>
</SvgUri>
</View>发布于 2020-12-17 09:47:47
这是个有名字的出口。把它当作
import { SvgUri } from 'react-native-svg';
https://stackoverflow.com/questions/65338207
复制相似问题