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

272
Visualizações
How can I transfer image data between next.js pages

I'm working on an Instagram clone (Just because I want to learn more about Next.js) and I want to manage the image uploads. Just want the user to upload his image and redirect it to the "create new post" page. The thing is, I don't know how to send the image between pages. I thought of doing a rest API to temporarily store the image and retrieve it, but that seems to be far too complicated. Does anyone have any idea of how I can implement this? I'm using Router from next.js if that helps.

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

0

Multiple ways depending your needs. You can try one of these.

  • Use React Context or a state management tool.

  • When routing from Page A to Page B, pass your data with querystring. Mask it with "as" prop if you dont want it to be shown on URL. If data is too big; pass it as a Blob URL. Then read query on the second page. https://nextjs.org/docs/api-reference/next/router#routerpush

  • Use localStorage. This is probably shortest way.

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