pRPC - redirect not working in callers
When using the
redirect$
function from prcp or the redirect
function from solid-router it just does not redirect.
Doing the same in a plain server function works as intended.
13 Replies
return redirect$(
Instead of throw
In pRPC, redirect is a utility function
Its not being used the same way it is in server function
In solid you use throw redirect instead of returning - in order to not confuse the actual return type of the function
Bur pRPC is smart enough to omit out the redirect type and only take the actual return type
Still not redirecting
That’s odd, if you open the network tab what does the response look like
Oh wait
Is the request being made?
I thing that it is it
onClick instead of onclick
Is this the issue?
I tried to console.log in the action but I see nothing
^ try
If it doesn’t work lmk i will fix it in a bit i think i might know what is it
Changing from "onClick" to "onclick" works, but it still does not redirect
By "works" I mean that the console.log get executed
Yes i think i just found an issue with the useNavigate hook, updated Ryan so hopefully we figure it out soon
@him122 found the issue with the help of @Brendonovich so releasing a new version in a minute if you are up to test it
published
this should fix it
Yep it is working now
Awesome