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

Docs: Inline documentation for the 'legacyBehavior' property seems to specify an incorrect default value #41807

Closed
haykam821 opened this issue Oct 25, 2022 · 4 comments
Labels
good first issue Easy to fix issues, good for newcomers Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@haykam821
Copy link

haykam821 commented Oct 25, 2022

What is the improvement or update you wish to see?

These two documentation sources seem to conflict:

/**
* Enable legacy link behaviour.
* @defaultValue `true`
* @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7
*/

- [`legacyBehavior`](#if-the-child-is-a-tag) - Changes behavior so that child must be `<a>`. Defaults to `false`.

From my testing, the latter documentation is correct.

In addition, some other inline documentation appears outdated based on the now-default experiment flag:

// e: any because as it would otherwise overlap with existing types
/**
* requires experimental.newNextLinkBehavior
*/
onMouseEnter?: (e: any) => void
// e: any because as it would otherwise overlap with existing types
/**
* requires experimental.newNextLinkBehavior
*/
onTouchStart?: (e: any) => void
// e: any because as it would otherwise overlap with existing types
/**
* requires experimental.newNextLinkBehavior
*/
onClick?: (e: any) => void

Is there any context that might help us understand?

In Next.js 13, the new <Link> behavior was made default.

Does the docs page already exist? Please link to it.

No response

@haykam821 haykam821 added the Documentation Related to Next.js' official documentation. label Oct 25, 2022
@balazsorban44 balazsorban44 added good first issue Easy to fix issues, good for newcomers Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. and removed Documentation Related to Next.js' official documentation. labels Oct 26, 2022
@balazsorban44
Copy link
Member

Thanks, indeed the inline code documentation should reflect the new default behaviour. would you be interested in opening a PR?

@abayomi185
Copy link
Contributor

I'm happy to open a PR for this.

ijjk pushed a commit that referenced this issue Oct 27, 2022
## Addresses Issue #41807

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: Yomi Ikuru <[email protected]>
@mkayander
Copy link

This issue can be now closed i suppose.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

4 participants