Skip to content

Commit

Permalink
fix(vercel#37981): legacy link behavior with number children
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jun 25, 2022
1 parent f4fb3e0 commit 230fd33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ const Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(

children = childrenProp

if (legacyBehavior && typeof children === 'string') {
if (
legacyBehavior &&
(typeof children === 'string' || typeof children === 'number')
) {
children = <a>{children}</a>
}

Expand Down

0 comments on commit 230fd33

Please sign in to comment.