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

284
Visualizações
send getstaticprops data to other static pages, NextJS

im fetching a huge json data from an external API inside my getstaticprops. this data will then be divided into parts to be send to other static pages (hundreds of pages) as props.

// page1.tsx

const page1 = ({ page1Data }) => {
    ...
}

const getStaticProps: GetStaticProps = async () => {
    const res = await fetch('https://hugedata')
    const jsonData = await res.json()
    const { page1Data, page2Data, page300Data, ...allData } = jsonData

    return { props: { page1Data } }
}

i only know how to send the staticprops data to the component inside the file like this.

is there a way send these data to other static pages/routes ? (e.g. to page2.tsx)

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

0

It's not really possible to send data between pages. But you can see the methods described here.

I suggest you really check router and inspect data inside it, you can find a lot of info about data on the page.

P.S. As I see, you are trying to get a lot of data and you need to use pagination and split it to the parts, you can use this lib

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