Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
This is a react native project. My compiler finds the item variable to be undefined even though I used item in a function

I am trying to fix my routes in react native, to do so I'm using the item variable to navigate through my pages.

<TouchableOpacity
  style={{
    padding: 20,
    flexDirection: "row",
    backgroundColor: colors.background,
    justifyContent: "flex-end",
    alignItems: "center",
  }}
  onPress={navigation.navigate("Edit", { id: item.id })}
>
  <Text style={{ fontSize: 24 }}>Task</Text>
  <MaterialCommunityIcons
    name="plus"
    size={40}
    style={{
      color: colors.themeColor,
      backgroundColor: colors.white,
      borderRadius: 20,
      marginHorizontal: 8,
    }}
  />
</TouchableOpacity>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First use {()=> navigation.navigate("Edit", { id: item.id })}.If you are not using item variables in your code it will give you undefined. for example, if your id variable is a person so try using person.id. On the next page use route.params.person.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda