You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flowchart TD
A(Old URL of a member-only page) --"Toast: ”The URL of this page has been changed. Update your bookmark.”"--> B(Current URL of a member-only page)
B --"Toast: “You should login first to view this page.”"--> C(Login page)
Loading
remix-toast must have an ability yo retain both toasts while the above double redirects and show both of them in the login page.
However, getToast in the login page can get only the "You should login first to view this page" toast.
A new API getToasts looks like:
exportconstloader=async({ request, context }: Route.LoaderArgs)=>{// Extracts the toast from the requestconsttoasts=getToasts(context);// pass it to the client sidereturn{ toasts }}exportdefaultfunctionLoginPage({ loaderData }: Route.ComponentArgs){const{ toasts }=loaderDatauseEffect(()=>{for(consttoastof(toasts??[])){// Call your toast function herealert(toast.message);}},[...(toasts??[])])return(
...
);}
remix-toast must have an ability yo retain both toasts while the above double redirects and show both of them in the login page.
However,
getToastin the login page can get only the "You should login first to view this page" toast.A new API
getToastslooks like: