为什么 React-Toastify v.9 中的 toast.update 无法正常工作



为什么type和autoClose属性不工作?在react toastify包的版本9中。

const toast1 = toast.loading("Please wait...");
const data = await setBooks(e);
toast.update(toast1, {
        render: "Oooups.., something goes wrong!",
        type: toast.TYPE.ERROR,
        autoClose: 2000,
        closeButton: true,
      });

您必须将autoClose的加载设置为false才能工作。因此,将isLoading: false加入toast.update

toast.update(toast1, {
   render: "Oooups.., something goes wrong!",
   type: toast.TYPE.ERROR,
   autoClose: 2000,
   closeButton: true,
   isLoading: false
});

最新更新