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

296
Visualizações
How to refresh another page in react JS

So here:

I want to refresh page A but the refresh will trigger on page B. Is is any other way where it's not from the localstorage?

Because I'm working on an e-commerce website. And I want page A to refresh when a button on page B is clicked. So that the content of page A will be updated just like in page B.

To understand more:

page A is the order details screen for the customer or client page B is the order details screen for the partner or seller

So the idea is, when the partner/seller updated the order status (on the way, in the kitchen, complete) from page B, the page A will refresh so that the customer or client will see their updated order status.

I hope that makes sense. A help is really much appreciated. Thank you so much!

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

0

The scenario is pretty much like having an admin page and a client page. When updating status of a product's status from the admin page, we want to also update that of in the Client page.

I think you can use firebase/firestore: In the admin page you can update the document of a collection, for example product

const productRef = db.collection('product').doc('id_1');

const res = await productRef.set({
  status: "active"
}, { merge: true });

In the client site, we can listen change on that collection's document For example:

firestore().collection('product').onSnapshot(querySnapshot => {
// handle changes to documents in the collection here
})

By doing that it solves a bigger problem where user can be any browser or devices...

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