我想使用svg图像代替png图标,因为png渲染的图标质量不好。我有以下规范
"react-native": "^0.42.3",
"react-native-svg": "4.3.0",
"react": "^15.4.1"在"npm install“之后,当我在我的项目中导入react-native-svg时,它抛出了以下错误
ERROR in ./node_modules/react-native-svg/lib/SvgTouchableMixin.js
Module not found: Error: Can't resolve 'react-native/Libraries/Components/Touchable/Touchable' in '/home/payalverma/Projects/caro-mobile/node_modules/react-native-svg/lib'
@ ./node_modules/react-native-svg/lib/SvgTouchableMixin.js 1:296-360
@ ./node_modules/react-native-svg/elements/Shape.js
@ ./node_modules/react-native-svg/elements/Rect.js
@ ./node_modules/react-native-svg/index.js
@ ./app/components/common/DrawerContent.js
@ ./app/components/Home.js
@ ./app/components/routes/Navigation.web.js
@ ./app/index.js
@ ./index.web.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:5000 webpack/hot/dev-server ./index.web.js谁有类似的问题,或可以帮助我与same.any遗漏的依赖关系,需要安装?
发布于 2019-06-30 21:59:05
实际上,react-native-svg不会在依赖中包含react-native-web。但是,它包含在"/node_modules/react-native-svg/index.web.js".中
只需运行此命令
npm i react-native-web错误将被解决
发布于 2020-06-11 12:13:51
https://stackoverflow.com/questions/46394348
复制相似问题