Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 将不同的图像导入到本机svg的图像组件中 问题:_React Native_React Native Svg - Fatal编程技术网

React native 将不同的图像导入到本机svg的图像组件中 问题:

React native 将不同的图像导入到本机svg的图像组件中 问题:,react-native,react-native-svg,React Native,React Native Svg,伙计们,因为我已经有导入图像的问题,我需要在每个模式下显示不同的图像,但当尝试时 返回一个错误 Loading dependency graph, done. error: bundling failed: src\components\OptionImage\index.js: src\components\OptionImage\index.js:Invalid call at line 39: require("../../../assets/images/questions/" +

伙计们,因为我已经有导入图像的问题,我需要在每个模式下显示不同的图像,但当尝试时


返回一个错误

Loading dependency graph, done.
error: bundling failed: src\components\OptionImage\index.js: src\components\OptionImage\index.js:Invalid call at line 39: require("../../../assets/images/questions/" + imageName + ".png")
Loading dependency graph, done.
error: bundling failed: src\components\OptionImage\index.js: src\components\OptionImage\index.js:Invalid call at line 38: require('../../../assets/images/questions/' + imageName + '.png')
尝试


返回一个错误

Loading dependency graph, done.
error: bundling failed: src\components\OptionImage\index.js: src\components\OptionImage\index.js:Invalid call at line 39: require("../../../assets/images/questions/" + imageName + ".png")
Loading dependency graph, done.
error: bundling failed: src\components\OptionImage\index.js: src\components\OptionImage\index.js:Invalid call at line 38: require('../../../assets/images/questions/' + imageName + '.png')
使用


工作,但得到静态图像,我不能改变


谁能帮忙谢谢你。

我在这里找到了这个问题的答案。谢谢大家

svg模块的可能重复使用require('source/path'),此问题不适用于此链接解决方案,但感谢到目前为止解决了此问题,我不得不使用react native的本机映像。但我需要使用react native svg的本机图像