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

160
Views
No puedo pasar los apoyos estatales, dice indefinido

He estado tratando de pasar los datos de las notas a otro componente, pero no sé por qué dice indefinido.

 export default App = () => { const [notes, setNotes] = useState([ { key: 1, value: "Hello there what up", title: "Some Title for this" }, { key: 2, value: "I want to take notes", title: "another for this one" }, ]); return ( <View> <FlatList data={notes} renderItem={({ note }) => ( <View> <NoteItem note={note} /> </View> )} /> </View> ); };
 export default NoteItem = ({ note }) => { <Text>{note.title}</Text> ); };
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

En primer lugar, suponga que renderItem en Flatlist tiene una propiedad de 'nota' dentro. No lo hace, se llama elemento. ¿También pasa notas pero intenta deconstruir la nota? Debería ser así:

 export default App = () => { const [notes, setNotes] = useState([ { key: 1, value: "Hello there what up", title: "Some Title for this" }, { key: 2, value: "I want to take notes", title: "another for this one" }, ]); return ( <View> <FlatList data={notes} renderItem={({ item }) => ( <View> <NoteItem note={item} /> </View> )} /> </View> ); };
about 4 years ago · Juan Pablo Isaza Report

0

Esta sintaxis - ({ note }) - significa que el componente NoteItem espera que se establezca una prop llamada note ; sin embargo, en su lugar, está configurando el accesorio de notes .

Prueba esto:

 <FlatList data={notes} renderItem={({ item, index }) => ( <View key={index}> <NoteItem note={item} /> </View> )} />
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!