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

Include router.asPath caveats in docs #36876

Merged
merged 2 commits into from
May 22, 2022
Merged

Conversation

idkwhojamesis
Copy link
Contributor

@idkwhojamesis idkwhojamesis commented May 13, 2022

Description

As mentioned in #34197, which is linked in the current issue #36802, there are some caveats to using the asPath field on next/router as a prop, specifically when the page is rendered using SSR or automatic static optimization. I mention these caveats in both the automatic static optimization and useRouter pages.

I chose not to mention it on the Rewrites page since the problem is not directly related to rewrites, although the problem most frequently occurs on rewritten pages.

Please let me know if something should be changed or checked in my edits. I have not personally encountered this problem and my additions are based on my interpretation of the discussions from the linked issues. I may also be forgetting other things as this is my first ever pull request.

Bug

Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@ijjk ijjk merged commit 5b89366 into vercel:canary May 22, 2022
@idkwhojamesis idkwhojamesis deleted the csb-koifp6 branch May 22, 2022 03:02
@idkwhojamesis
Copy link
Contributor Author

Yay, first merged commit!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

asPath mismatch when using rewrites feature
2 participants