Unverified Commit 1cd76b9e authored by stefanprobst's avatar stefanprobst Committed by GitHub

Avoid anonymous function in next/link (#37154)

Avoid anonymous function in `next/link` so DevTools show `Link` instead of `Anonymous`:

Before:

![Screenshot_20220524_123016](https://user-images.githubusercontent.com/20753323/170018947-2d9bdd58-5311-4bba-ab6b-4dc9547092f6.png)

After:

![Screenshot_20220524_122946](https://user-images.githubusercontent.com/20753323/170018968-2993a24a-5518-4de1-b7a4-75cc6d6562f2.png)

## 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`
Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
parent e4bf1a51
...@@ -125,7 +125,7 @@ type LinkPropsReal = React.PropsWithChildren< ...@@ -125,7 +125,7 @@ type LinkPropsReal = React.PropsWithChildren<
> >
const Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>( const Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(
(props, forwardedRef) => { function LinkComponent(props, forwardedRef) {
const { const {
legacyBehavior = Boolean(process.env.__NEXT_NEW_LINK_BEHAVIOR) !== true, legacyBehavior = Boolean(process.env.__NEXT_NEW_LINK_BEHAVIOR) !== true,
} = props } = props
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment