-
Notifications
You must be signed in to change notification settings - Fork 28.3k
redirect()
function not redirecting in client components
#59163
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
Comments
|
redirect()
function not redirecting on client componentsredirect()
function not redirecting in client components
In the first paragrapth the docs say we can use it in client components, however I believe the explanation to this problem is this If that's the case, I wonder what an use case for redirect in client components would be? |
|
To perform client-side navigation (redirect) in a client component, you should use the |
router.push doesnt work on mobile devices |
Hey he was asking for the server components. Do you know why is redirect not working in the try catch block? |
Link to the code that reproduces this issue
https://github.com/pedro757/redirect-issue-client-components
To Reproduce
Current vs. Expected behavior
Currently it's not redirecting to the otherpage
I expect to actually redirect to the otherpage
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Mon Nov 20 12:57:36 UTC 2023 Binaries: Node: 20.5.1 npm: 10.2.1 Yarn: 1.22.19 pnpm: 8.10.3 Relevant Packages: next: 14.0.4-canary.32 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router, Routing (next/router, next/navigation, next/link)
Additional context
I have used redirect in server actions and it seems to be working good, the problem seems to be on client components
The text was updated successfully, but these errors were encountered: