为什么 type 和 autoClose 属性不起作用?在版本 9 的 react toastify 包中。
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,
});
最佳答案
您必须将加载设置为 false,autoClose
才能工作。
所以将 isLoading: false
添加到 toast.update
。
toast.update(toast1, {
render: "Oooups.., something goes wrong!",
type: toast.TYPE.ERROR,
autoClose: 2000,
closeButton: true,
isLoading: false
});
关于javascript - 为什么 React-Toastify v.9 中的 toast.update 不能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71891267/