Функции не действительны в качестве предупреждения React Child и не могут отображать мои изображения - PullRequest
0 голосов
/ 06 мая 2019

Я пытаюсь накладывать свои изображения друг на друга и реализую смахивание (например, трут).но я не могу отобразить свои изображения, вместо этого я просто получаю предупреждение,

Функции недействительны как реагирующий ребенок

  import React, { Component } from 'react';
  import {StyleSheet, Dimensions, View, Animated, Image } from 'react-native';
  const SCREEN_HEIGHT = Dimensions.get('window').height
  const SCREEN_WIDTH = Dimensions.get('window').width
        //my images
  const Users = [
          { id: "1", uri: require('./assets/image1.jpeg') },
          { id: "2", uri: require('./assets/image2.jpeg') },
          { id: "3", uri: require('./assets/image3.jpeg') },
          { id: "4", uri: require('./assets/image4.jpeg') },
        ]
        export default class App extends Component {
          render() {
//i tried doing this map outside render too , but did not work
            const Images = Users.map((item, i) => {
              return (
                <Animated.View key={item.id} style={{ height: SCREEN_HEIGHT - 120, width: SCREEN_WIDTH, padding: 10, position:'absolute'}}>

                  <Image style={{ flex: 1, height: null, width: null, borderRadius: 20 }} source={item.uri} />

                </Animated.View>
              )
            }
            ).reverse
            return (
              <View style={styles.container}>
                <View style={{ height: 60 }}>
                </View>
                <View style={{ flex: 1 }}>
                {Images} // not getting rendered here
                </View>
                <View style={{ height: 60 }}></View>
              </View>
            );
          }
        }
        //styles
        const styles = StyleSheet.create({
          container: {
            flex: 1,
          }
        });

Я не смог отрендерить свои изображения, на экране появилось предупреждение о недопустимых функциях в качестве реагирующего ребенка

...