How to use the react-toastify.toast.update function in react-toastify

To help you get started, we’ve selected a few react-toastify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github timroesner / WeMart / src / Checkout.js View on Github external
    toastSuccess = () =&gt; toast.update(this.orderToast, { type: toast.TYPE.SUCCESS,autoClose: 3000, render: <div><h4>Order Succesfully Placed</h4><h5>Redirecting to homepage</h5></div>, onClose: () =&gt; this.props.history.push('/home') });
    toastFail = () =&gt; toast.update(this.orderToast, { type: toast.TYPE.ERROR, autoClose: 4000, render: "Something Went Wrong"});
github Wicklets / wick-editor / src / Editor / Editor.jsx View on Github external
updateToast = (id, options) => {
    if (options.text) {
      options.render = options.text;
    }

    if (options.type) {
      options.className = options.type + '-toast-background';
    }

    if (!options.autoClose) {
      options.autoClose = 5000;
    }

    toast.update(id, options);
  }
github flatlogic / react-dashboard / src / pages / notifications / Notifications.js View on Github external
  launchNotification = (id) => toast.update(id, { ...this.state.options, render: "Thermonuclear war averted", type: toast.TYPE.SUCCESS });
github brillout / handli / live-demo / src / cases / custom-ui / customUi.js View on Github external
  const update = msg => reactToastify.update(toastId, {render: div(msg)});
  const close = () => reactToastify.dismiss(toastId);
github flatlogic / react-material-admin / src / pages / notifications / Notifications.js View on Github external
function retryErrorNotification() {
    var componentProps = {
      type: "message",
      message: "Message was sent successfully!",
      variant: "contained",
      color: "success",
    };
    toast.update(errorToastId, {
      render: ,
      type: "success",
    });
    setErrorToastId(null);
  }
github theRoughCode / WatsMyMajor / react-ui / src / components / tools / LoginPrompt.jsx View on Github external
export const fireLoginPrompt = (history, pathname, text) =&gt; {
  if (active) {
    toast.update(toastId, {
      render: ,
      autoClose: 5000
    });
    return;
  }
  active = true;
  toastId = toast.error(, {
    onClose: () =&gt; active = false,
  });
};
github Azure / azure-iot-explorer / src / app / notifications / components / notificationToast.tsx View on Github external
export const raiseNotificationToast = (notification: Notification) =&gt; {
    const component = fetchComponent(notification);
    const options: ToastOptions = {
        bodyClassName: 'notification-toast-body',
        closeButton: ,
        position: toast.POSITION.TOP_RIGHT,
        progressClassName: `notification-toast-progress-bar`,
        toastId: notification.id,
        type: ToastType.DEFAULT
    };

    if (notification.id &amp;&amp; toast.isActive(notification.id)) {
        const updateOptions = options as UpdateOptions;
        updateOptions.render = component;
        toast.update(notification.id, options);
    }
    else {
        toast(component, options);
    }
};
github flatlogic / react-material-admin / src / pages / notifications / NotificationsContainer.js View on Github external
retryErrorNotification: props =&gt; () =&gt; {
      const componentProps = {
        type: "message",
        message: "Message was sent successfully!",
        variant: "contained",
        color: "success",
      };

      toast.update(props.errorToastId, {
        render: ,
        type: "success"
      });
      props.setErrorToastId(null);
    }
  }),
github sandiz / rs-manager / src / lib / libworker.js View on Github external
<input checked="{t}" type="checkbox" id="markascdlc">
                    
                
            
        )
        if (this.toastID == null) {
            this.toastID = toast(d(this.toastMarkAsCDLC), {
                autoClose: false,
                closeOnClick: false,
                className: "toast-bg toast-watcher",
                onClose: this.dismiss,
            });
        }
        else {
            toast.update(this.toastID, {
                render: d(this.toastMarkAsCDLC),
            });
        }
    }
github poetapp / frost-web / src / sagas / VerifiedAccount.saga.ts View on Github external
if (e.includes('Email already verified')) {
      browserHistory.push('/dashboard')
      toast.info(e, {
        className: 'toast',
        autoClose: 2500,
      })
    } else if (e.includes('Expired token')) {
      const message = 'This link has expired. Please login and request a new validation email.'
      toast.update(toastId, {
        render: message,
        type: toast.TYPE.ERROR,
        className: 'toast',
        autoClose: false,
      })
    } else
      toast.update(toastId, {
        render: e,
        type: toast.TYPE.ERROR,
        autoClose: false,
        className: 'toast',
      })
  }
}