Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Variable de lista plana enviada con navegar en React native pero no se puede mostrar

Pasé y declaré una variable (elemento) con navegar, pero dentro de "retorno", dice indefinido.

aquí variable (elemento)

 {id: "001" name: "name"}

código

 import React, {useState,useEffect} from "react"; import {Text, View} from "react-native"; import styled from "styled-components/native"; import { TouchableWithoutFeedback, TouchableOpacity} from "react-native-gesture-handler"; const PlaySystem= ({navigation,route}) => { const {data}= useState(null) useEffect(()=>{ let {data} =route.params; console.log("first",data.id) },[]) return ( <Container> <StatusBar barStyle="Light-content"/> <View> <Text>{data?.name}</Text> { console.log("second",data.id) } </View> </Container>);} export default PlaySystem;

consola.log muestra:

 second undefined first 001
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hazlo asi -

 const PlaySystem= ({navigation,route}) => { let {data} =route.params; return ( <Container> <StatusBar barStyle="Light-content"/> <View> <Text>{data?.name}</Text> </View> </Container>);} export default PlaySystem;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!