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
When applying a Proxy to router.push from next/navigation, the router.push function returned by createNavigation captures an outdated reference. As a result, it attempts to call a revoked function instead of the updated one.
Verifications
I've verified that the problem I'm experiencing isn't covered in the docs.
However, the router.push function created in createNavigation captures the previous value, causing it to reference a revoked function.
I expected that proxying the router from next/navigation would work seamlessly with next-intl, but that wasn't the case.
Expected behaviour
Proxying the router from next/navigation should work seamlessly with next-intl, ensuring that router.push does not retain a stale reference and operates as expected.
The text was updated successfully, but these errors were encountered:
Description
When applying a
Proxy
torouter.push
fromnext/navigation
, therouter.push
function returned bycreateNavigation
captures an outdated reference. As a result, it attempts to call a revoked function instead of the updated one.Verifications
Mandatory reproduction URL
https://github.com/Lee-Minhoon/next-intl-proxy
Reproduction description
Since the router.push returned from the createNavigation function is captured, the proxy pattern cannot be applied.
I tested this by implementing it in the same format as next-intl's
createNavigation
.Below is a code snippet demonstrating my approach. This snippet applies a
Proxy
torouter.push
.However, the
router.push
function created increateNavigation
captures the previous value, causing it to reference a revoked function.I expected that proxying the
router
fromnext/navigation
would work seamlessly with next-intl, but that wasn't the case.Expected behaviour
Proxying the
router
fromnext/navigation
should work seamlessly with next-intl, ensuring thatrouter.push
does not retain a stale reference and operates as expected.The text was updated successfully, but these errors were encountered: