Closed wobsoriano closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
vue-sonner | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 3, 2023 10:07pm |
LGTM
Hi @wobsoriano , just out of curiosity, what is the major issue that causes memory leaking here?
Is it related to shallowRef
?
@cjboy76 For rendering a custom toast, yes. Unlike markRaw
, shallowRef
still proxies the component.
Not sure about the specifics of why this is happening, though.
What is the answer because im STILL getting this error and im running the latest version 1.1.2
toast.custom(markRaw(JobItemWrapper), {
componentProps: {
JOB_ID: job.job_id,
},
duration: Infinity,
});
The toast is showing but when i close it using toast.dismiss(0)
it returns
Uncaught (in promise) Maximum recursive updates exceeded in component <Toaster>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.
Please help me. @wobsoriano @xiaoluoboding @cjboy76
@xiaoluoboding any update? its been couple months..
This PR fixes custom component usage by:
markRaw
instead ofshallowRef
so that the component will never be converted to a proxyToast
component receives and calls thedeleteToast
function.Fixes
Any custom component then can just do
$emit('closeToast')
and the toast should close. Here's an example: