Skip to content

Support Number Type for next/link children #37981

@flyingSquirrel-dev

Description

@flyingSquirrel-dev

Describe the feature you'd like to request

I think it would be better to support the number type for next/link children.
Can I open a PR to support it if it's okay with you? :)

Describe the solution you'd like

// packages/next/client/link.tsx
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
  children = <a>{children}</a>
}

Describe alternatives you've considered

Add a condition to check the type of children

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions