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

123
Visualizações
Mapping an array in my Next JS app not working

In my Next JS app I'm getting array and mapping them for the nav bar. but when i do it throws an error of TypeError: _utils_navigation__WEBPACK_IMPORTED_MODULE_6___default(...).map is not a function. my code is as follows.

{NavRoutes.map((navs, index) => {
            console.log(navs.title);
            console.log('bhsjvhjvs');
            return (
              <Link href={navs.link}>
            <div className={`${
              router.asPath === navs.link 
              ? "text-active-red"
              : ""
            }`}>{navs.title}</div>
          </Link>
            )
          })}

and the array

const NavRoutes = [
    {
      title: "HOME",
      link: "/"
    },
    {
      title: "NEWS",
      link: "/news"
    },
    {
      title: "CHANNEL",
      link: "/channels"
    },
    {
      title:"SHOWS",
      link: "/shows"
    },
    {
      title: "SCHEDULE",
      link: "/schedules"
    },
    {
      title: "CONTACT",
      link: "/contact"
    },
]

export default NavRoutes;

so how can i work through this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

check how you have imported it. It should be like this

import NavRoutes from "../utils/navigations.js";

And apart from this, try to console NavRoutes and check you are getting expected value or not.

about 4 years ago · Juan Pablo Isaza 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