-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toast not working properly #13
Comments
Hi @yarapolana , thank you so much! I think the issue has something to do with the fact that you're spreading the toastHeaders like that, headers are not normal JS objects so they don't really act the same, what happens if you return headers: toastHeaders? |
@AlemTuzlak You are welcome not working
|
Hi @yarapolana, I am facing the same issue as well with multiple headers. Do you have a solution for this yet? |
Do you guys mind creating a minimum repro so I can check it out |
also would you mind trying using this: export function combineHeaders(...headers: Array<ResponseInit["headers"] | null | undefined>) {
const combined = new Headers();
for (const header of headers) {
if (!header) {
continue;
}
for (const [key, value] of new Headers(header).entries()) {
combined.append(key, value);
}
}
return combined;
}
headers: combineHeaders(toastHeaders,otherHeaders) |
@AlemTuzlak I found out what my issue was. On the Now how can I still use shouldRevalidate and the toast? |
Same issue here. Using the latest Remix without |
I am also seeing this issue. Always appears twice on refresh and is never evicted from the cookie. I am also using cookie-based auth, which i am checking prior to getting to this toast stage, so perhaps the issue lies therein |
Might be related to remix-run/remix#5647 (comment) |
@grundmanise This might be the actual cause of it but that might be solved when single fetch is released and the API is changed. Unfortunately I can't do much to help without a reliable repro to help figure it out, but if it's caused by a race-condition in Remix there's really not much I could do. I believe you guys are having an issue but I have no idea how to solve it unfortunately 😢 |
Hi I followed the initial steps to get the toast going with sonner see below, but it is not working.
Expected behaviour:
Toast to work when being called.
What is happening:
Toast gets called on refresh twice, and doesn't get cleared, if I refresh it continues to get called.
Is something else missing?
from route
from root
using
Edit: Just wanted to say congrats with the lib though, fantastic explanation on the blog.
The text was updated successfully, but these errors were encountered: