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

462
Views
¿Cómo puedo renderizar Two-dimensions-Array en JSX (React Native)?

Estoy codificando Two-dimensions-Array en ReactNative.

Single-Array tiene éxito en JSX.
Pero no entiendo cómo usar Two-dimensions-Array en JSX.
¿Podemos usar Two-dimensions-Array en JSX?

La representación es exitosa

 <View> {myDoubleArray.map(loop => { return <Text>{loop}</Text>; })} </View>

La representación no es nada (mi pregunta)

 <View> {myDoubleArray.map(loop => { loop.map(elm => { return <Text>{elm}</Text>; }); })} </View>

myDoubleArray es una matriz de dos dimensiones como esta.

 const myDoubleArray = new Array(5).fill(null); for (let y = 0; y < 5; y++) { myDoubleArray[y] = new Array(3); for (let x = 0; x < 3; x++) { myDoubleArray[y][x] = y + ' : ' + x; } }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No devuelve un valor de la función de mapa externo. Entonces, el producto de esto es una matriz de s indefinidos . Solo necesita una declaración de devolución :

 <View> {myDoubleArray.map(loop => { return loop.map(elm => { return <Text>{elm}</Text>; }); })} </View>
about 4 years ago · Juan Pablo Isaza Report

0

Hay dos problemas en su código: no devuelve nada y olvidó asignar una clave. Usé los índices, no es excelente, pero no conozco el contenido de su matriz.

 <View> {myDoubleArray.map((loop, indexA) => loop.map((elm, indexB) => ( <Text key={`${indexA}_${indexB}`}>{elm}</Text> )) )} </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!