Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/462.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.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
Javascript react native snap carousel返回“;无法读取属性';concat&x27;“未定义”的定义;当我使用RenderTime时_Javascript_Reactjs_React Native_React Native Android_React Native Snap Carousel - Fatal编程技术网

Javascript react native snap carousel返回“;无法读取属性';concat&x27;“未定义”的定义;当我使用RenderTime时

Javascript react native snap carousel返回“;无法读取属性';concat&x27;“未定义”的定义;当我使用RenderTime时,javascript,reactjs,react-native,react-native-android,react-native-snap-carousel,Javascript,Reactjs,React Native,React Native Android,React Native Snap Carousel,我正在学习React-Native并在我的项目中使用React-Native snap carousel。 我想显示一些图像,但出现错误无法读取未定义的属性“concat” 这是我的密码 const HomePage = (props) => { let imageList = ['../images/index-bg.png', '../images/down.png']; const renderImage = ({ item, index }) => {

我正在学习React-Native并在我的项目中使用React-Native snap carousel。 我想显示一些图像,但出现错误
无法读取未定义的属性“concat”

这是我的密码

const HomePage = (props) => {
   let imageList = ['../images/index-bg.png', '../images/down.png'];

   const renderImage = ({ item, index }) => {
       return (
            <View>
                <Image source={require(item)}></Image>
            </View>
        )
    };

   return (
     <View> 
            <Carousel
                loop={true}
                autoplay={true}
                data={imageList}
                renderItem={renderImage}
                sliderWidth={pxToDp(50)}
                itemWidth={pxToDp(100)}
            />

     </View>
   )

}
const主页=(道具)=>{
让imageList=['../images/index bg.png','../images/down.png'];
常量渲染年龄=({item,index})=>{
返回(
)
};
返回(
)
}
如果我改变

          <View>
                <Image source={require(item)}></Image>
            </View>


···
它工作得很好
我希望它能像[用法](https://github.com/archriss/react-native-snap-carousel)但它不起作用。
你试过这个吗

let imageList = [require('../images/index-bg.png'), require('../images/down.png')];
然后

  <View>
    <Image source={item}></Image>
  </View>

必须在运行前定义RN中图像所需的源


让我知道它是否有效

它工作得很好!谢谢,这真的帮了我大忙!如果你愿意,接受答案,这样别人也会很容易得到帮助
  <View>
    <Image source={item}></Image>
  </View>