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

273
Views
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 answers
Answer question

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 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!