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

136
Vistas
Toast.warn render twice on refresh of page

I'm facing an issue where the toast message is rendered twice on page load.

The props are being passed with Link

<Link to={{ pathname: `/administration/person/add`, merchantData: { merchant } }}>Create Person</Link>

and another page by grabbing the data with useLocation

cons {merchantData} = useLocation();

What I want is on page load and when the data is lost, it should give a warning message with the code below.

useEffect(() => {
        if (merchantData === undefined) {
            toast.warn('Please Select Merchant');
        }
    }, [merchantData]);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can add an ID to your toast to prevent a duplicate toast from appearing.

toast.warn('Please Select Merchant', {
  toastId: "your-id"
});

You can learn more in their documentation: https://fkhadra.github.io/react-toastify/prevent-duplicate

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