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

131
Views
Los datos de búsqueda de nextjs no se muestran en la plantilla y cómo evitar que la URL de búsqueda llame dos veces

Puedo ver mis datos de API desde mi terminal y también está llamando dos veces. También quiero mostrar datos en mi plantilla de página. Pero no sé dónde estoy cometiendo un error y no se muestra ningún dato en mi plantilla:

aquí está mi código:

 export default function Content({ blog }) { return ( <> {blog.map((blogs) => { { blogs.blog_title; } })} </> ); } export async function getServerSideProps() { // Fetch data from external API const url = "http://127.0.0.1:8000/blog-api"; const headers = { "Content-Type": "application/json", Authorization: "<secret>", }; const res = await fetch(url, { headers: headers }); const data = await res.json(); console.log(data); // Pass data to the page via props return { props: { blog: data, }, }; }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Olvidó devolver el valor del método .map

 export default function Content({ blog }) { return ( <> {blog.map((blogs) => <span key={blogs.id}>{blogs.blog_title}</span>)} </> ); }
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!