Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
How to use map function and render list in reactjs

I was trying to load this array and render it as a table using map function how can I do it. The array response is from useState.

I have tried using list indexing and rendering the array as a table but the array changes its number of columns and rows dynamically so indexing does not work as the number of columns and rows keep on changing.

Sample image is shown below: enter image description here

what I have tried

 {arrayData.map(function (item) {
  return item;
 })}

and got output like enter image description here

let array = [
    [
14.203298568725586,
5.916393756866455,
15.5038480758667,
15.5038480758667,
15.5038480758667
],
[
20.115657806396484,
7.724868297576904,
19.88268280029297,
19.88268280029297,
19.88268280029297
],
[
14.476829528808594,
6.237934112548828,
13.77694320678711,
13.77694320678711,
13.77694320678711
],
[
14.203298568725586,
5.916393756866455,
15.5038480758667,
15.5038480758667,
15.5038480758667
],
[
14.203298568725586,
5.916393756866455,
15.5038480758667,
15.5038480758667,
15.5038480758667
],
]
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

The name of your array and the what you're trying to map do not match.

So

let array

Should be:

const arrayData

For:

 {arrayData.map((item) => {
  return item;
 })}

To work. Also note arrays should be updated with useState so if that's the reason you're using let. You don't mention any further code for the grid you're trying to do. Are you passing this to a component in the map or building everything when looping?

You also have a multidimensional array so I'm unsure what your goal is when you only show one map.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda