Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

577
Vistas
Map Method not returning data on Nextjs

I'm trying to do a simple Map Method, the data 1,2,3,4,5 can be successfully shown in console.log, but not showing on the website.

import React from 'react'

export default function secretStashScreen() {
const numbers = [1, 2, 3, 4, 5];
  return (
    <div>
    {numbers.map((number)=>{<div>{number}</div>}) 
    }
    </div>
  )
}

Warning code after compiled:

warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/d
Error: Aborted because ./pages/secret-stash.js is not accepted
Update propagation: ./pages/secret-stash.js -> ./node_modules/next/dist/build/webp    at applyHandler (http://localhost:3000/_next/static/chunks/webpack.js?ts=16572
    at http://localhost:3000/_next/static/chunks/webpack.js?ts=1657263030521:564:2
    at Array.map (<anonymous>)

Is there anything I did wrong?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You should remove brackets in map for returning values

numbers.map((number)=><div>{number}</div>) 

If you want to keep brackets, you should have return explicitly

numbers.map((number)=>{return <div>{number}</div>}) 
about 4 years ago · Juan Pablo Isaza Denunciar

0

Remove your {} bracket

{numbers.map((number)=><div>{number}</div>)}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda