Closed jllanosg closed 1 month ago
const [showToast, setShowToast] = useState(false); const handleShowToast = () => { setShowToast(true); setTimeout(() => setShowToast(false), 3000); // Ocultar el toast después de 3 segundos }; return ( <div className="p-4"> <button onClick={handleShowToast} className="bg-blue-500 text-white px-4 py-2 rounded"> Show Toast </button> {showToast && ( <Toast message="This is a toast message!" type="success" onClose={() => setShowToast(false)} /> )} </div> );
Presionando el botón debe aparecer el componente toast abajo a la derecha.
Probar cambiando el type a info o error; debe cambiar el color del toast.
Agrega componente genérico Toast
How to test
Presionando el botón debe aparecer el componente toast abajo a la derecha.
Probar cambiando el type a info o error; debe cambiar el color del toast.
Acknowledgements