Skip to content
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

Compatibility with next intl #9

Open
spaquis opened this issue Nov 17, 2024 · 1 comment
Open

Compatibility with next intl #9

spaquis opened this issue Nov 17, 2024 · 1 comment

Comments

@spaquis
Copy link

spaquis commented Nov 17, 2024

Hey,
Thank you for your work on this subject.

I have a screen where I put the navigation guard, it works perfectly. But on this screen you can change the language of the application.
To do this, I use nextIntl with this:
router.push(${pathName}?${searchParams.toString()}, { locale: lang });

My strategy was to disable the guard before calling router.push and then re-enable it afterwards (the enableGuard state is placed in a context that wraps the whole page).
The problem is that after pushing the new router with the locale changes, the guard no longer works.

Can you help me.
Regards,

@ypresto
Copy link
Collaborator

ypresto commented Nov 19, 2024

Thank you for reporting!

It might be interfering with next-intl itself, as it seems creating custom router too.

Can you provide a reproduction repo? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants