Skip to content

Commit 92c5aa8

Browse files
authored
Update scrolling example using query param instead of hash (#31473)
The example cited doesn't make sense, unless I'm truly missing something. The example is talking about hashes... i.e. #about. Not a query param, like ?=count=10. So in the example, the scroll={false} doesn't make any sense, since the href is not using a hash/anchor tag. I could be wrong, so be gentle. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
1 parent a178072 commit 92c5aa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/api-reference/next/link.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ The default behavior of the `Link` component is to `push` a new URL into the `hi
204204
The default behavior of `Link` is to scroll to the top of the page. When there is a hash defined it will scroll to the specific id, like a normal `<a>` tag. To prevent scrolling to the top / hash `scroll={false}` can be added to `Link`:
205205

206206
```jsx
207-
<Link href="/?counter=10" scroll={false}>
207+
<Link href="/#hashid" scroll={false}>
208208
<a>Disables scrolling to the top</a>
209209
</Link>
210210
```

0 commit comments

Comments
 (0)