-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Improve Link documentation #10225
Merged
timneutkens
merged 2 commits into
vercel:canary
from
chibicode:improve-link-documentation
Jan 23, 2020
Merged
Improve Link documentation #10225
timneutkens
merged 2 commits into
vercel:canary
from
chibicode:improve-link-documentation
Jan 23, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Legacy Client Bundles (polyfills)
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 14ec8ca |
timneutkens
approved these changes
Jan 23, 2020
Looks great! |
This was referenced Feb 18, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves the next/link API documentation in general.
First, I grouped two sections about
forwardRef
andpassHref
next to each other because they both talk about gotchas when using custom chidlren. This madepassHref
to appear earlier in the page, which I think is good because a lot of people seem to run into this issue.Second, I explicitly used
styled-components
as an example forpassHref
. Previously it was usingUnexpected_A
, which was a very strange name (what’s unexpected?).styled-components
is popular enough (see this comment which got a lot of upvotes), and even if the user's using some other libraries, they'll probably understand thestyled-components
example better thanUnexpected_A
.Third, I tightened the wording for
passHref
doc. The earlier version (from #2503) was too wordy.Fourth, I added a note about emotion - if you use emotion, even if you use the
<a>
tag directly, you’ll still needpassHref
because emotion’s custom JSX pragma strips away thetype
attribute from each element. Emotion is pretty popular, and you basically would have to find this issue to figure out why this is happening, so I thought adding a note here would help.Fifth, the
forwardRef
example (from #8428) was missingpassHref
onMyButton
.