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

150
Vistas
Render react component after redirecting (Next.js, serversiderendering)

i'm new to next.js, and stucked in one problem i have some static links which are redirecting to search.tsx under pages folder

current behavior : now, if i click on any links , first it will wait for API response and then render search page

expected : - it should render first and then wait for API response

search.tsx

export const getServerSideProps = async (props: any) => {
    const apiResponse = await api.getProperties()
    return {
       props: {
       ...apiResponse,
   },
  }
}
const Search = (props: any) => {
  </searchResult>
}
export default Search
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

getServerSideProps runs whenever the page exporting this async function is requested, getServerSideProps is used for SSR, if you want to render the page and then fetch data, then you will have to do it in client side, you can use useEffect which can be used to fetch data because it only runs on the client side.

useEffect(()=>{
 async function fetchData(){
    // getch data fro API and set state

 },
fetchData()
},[])

refer here for more about getServerSideProps

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