diecodev / qwik-sonner

An opinionated toast component for qwik.
https://qwik-sonner.deno.dev/
34 stars 3 forks source link

`closeButton` option breaks toast #10

Closed ziimakc closed 5 months ago

ziimakc commented 6 months ago

Reproduction:

Root (without closeButton everything works fine):

<Toaster expand visibleToasts={3} closeButton />

Component

<h1 onClick$={() => toast.error("xx")}>XXX</h1>

Error:

The value passed in onClick$={...}> must be a QRL, instead you passed a "function". Make sure your function is wrapped with $(...), so it can be serialized. Like this:
$(()=>{
                deleteToast();
                props.toast.onDismiss$?.(props.toast);
            }) Error: The value passed in onClick$={...}> must be a QRL, instead you passed a "function". Make sure your function is wrapped with $(...), so it can be serialized. Like this:
$(()=>{
                deleteToast();
                props.toast.onDismiss$?.(props.toast);
            })
diecodev commented 5 months ago

I'm gonna work on this today. Gonna ping you when I fix it. :D

diecodev commented 5 months ago

@ziimakc this should be fixed in the last version of the pkg, pls try it out and lmk if it is. Thanks for the PR, tho.

ziimakc commented 5 months ago

Works fine now, thanks!