-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[examples] Next.js v13 use legacy behavior to fix example #34970
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, I was planning to tackle this today :) The changes look good, I've tested them locally. This seems to fix #34893, the server-side rendering looks good.
Tagging @siriwatknp for a final review. |
Makes sense. At this moment we have only one next.js example that depends on |
Speaking on dependency on latest, this looks like we should depend on latest, 18 was released some time ago 😁
From what I understand, developers can easily migrate from Next.js v12 to v13: https://nextjs.org/blog/next-13#breaking-changes. So if we assume that most people looking at our example are starting a new project, I think that v13 would be good enough. But if we were publishing a Next.js dedicated component, I think that supporting both would have been important. |
I see many issues open regarding next13 migration and they are labeled as completed and merge and people are saying nice work and stuff but couldn't see any working example without _document.js |
I ran into a weird error. I'm using next13 |
next13 still have many issues in the app directory. many people are not upgrading and are sticking to 12 until 13 is stable. so having two examples would really help. |
@madaher-dev Why not use Next.js v13 with the stable |
Because the app/folder pages is not the only hold back in a next 13 migration. For example you still cant setCookie as cookies-next is not supported in 13. There are some issue also with importing script with a windows environment etc. Next 13 is a great concept but launching it in the way they did was premature imho |
Background 📚
Relates to #34898
In Next.js v13
Link
component now renders aa
tag and does not allowa
tag as a child.Next.js v13 release blog post
Next/link docs
This is a breaking change and currently causes errors in the next.js examples. Aim of this pull request is to fix those breaking changes and simplifying the examples could be done in a separate pull request which might need some more discussion.
Changes 🕹
Adds support for
legacyBehaviour
prop inNextLinkComposed
andLink
components in the next.js examples reposMakes the
true` by default so it's compatible with the current implementation
legacyBehaviour
propI have followed (at least) the PR section of the contributing guide.
Fixes #34893