Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

104
Vistas
Objects are not valid as a React child. If you meant to render a collection of children, use an array instead - FlatList

React-native Expo CLI ,FlatList I'm trying use a FlatList. but its showing me error as-

  • Error: Objects are not valid as a React child (found: object with keys {seconds, nanoseconds}). If you meant to render a collection of children, use an array instead.

faltList code

{
 (PostLoaded)?<FlatList
  data = {PostData}
  keyExtractor = {item => item.key}
  renderItem={(itemData) => {
    const PostInfo = itemData.item;
    // console.log(PostInfo.Name);
    return(
      <View style={style.petshowContainer}>
        <Image source={{uri:PostInfo.Image}}
          style={{width:150,height:175,borderTopLeftRadius:10,borderBottomLeftRadius:10,}}
          resizeMode='cover'
        />
       <View style={{margin:10}}>
       <Text style={{fontSize:25}}>{PostInfo.Name}</Text>
       <View style={{flexDirection:'row',alignItems:'center'}}>
       <Text style={{fontSize:15,marginRight:20}}>{PostInfo.Age}/ {PostInfo.Breed}</Text>
       <Button mode='outlined' style={{borderColor:'blue'}}>{PostInfo.Gender}</Button>
    </View>
   <Text style={{marginBottom:5}}>Available for : </Text>
   <Text>{PostInfo.From_Date} - 11/10/2021</Text>
   <Button mode="contained" style={{marginTop:10}}>PetME</Button>
     </View>
    </View>
    )
}}
  style={{backgroundColor:'red'}}
  />:<Text>loading...</Text>
}

And Post Data is an array contains object received from firebase

PostData = [{name:"narendra",Age:5.......},{.....}]
7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

this was caused beacuse of wrong date formate

<Text>{PostInfo.From_Date} - 11/10/2021</Text>
7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos