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

501
Views
TypeError: undefined no es un objeto (evaluando 'route.params.id')

Estoy tratando de agregar una entrada de competencia a mi base de datos de competencias en firebase pero recibo el error:

TypeError: undefined no es un objeto (evaluando 'route.params.id')

Aquí está mi código:

 const AddEntry = ({route, navigation}) => { const id = route.params.id const [title, onChangeTitle] = React.useState('') const [image, setImage] = React.useState("/") const pickImage = async () => { // No permissions request is necessary for launching the image library let result = await ImagePicker.launchImageLibraryAsync({ mediaTypes: ImagePicker.MediaTypeOptions.All, allowsEditing: true, aspect: [4, 3], quality: 1, }); console.log(result); if (!result.cancelled) { setImage(result.uri); } }; const AddEntry = async() => { let imageUrl = await handleImageUpload() addEntryToComp({title, imageUrl}, id) } //Image code here return( <View> <Text>Add Entry</Text> <Text>{id}</Text> <Button title='Upload Entry Image' color="red" onPress={pickImage}></Button> <Button title='Save' color="purple" onPress={AddEntry}></Button> </View> ) } export default AddEntry

¿Algunas ideas?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Los parámetros se utilizan para pasar datos a la ruta colocándolos en un objeto como un segundo parámetro para la función de navegación.navegar.

Por ejemplo:

 navigation.navigate('AddEntry', { id })

... y luego puede acceder a los parámetros pasados desde route.params.

Más aquí: https://reactnavigation.org/docs/params/

about 4 years ago · Santiago Gelvez 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!