Fix remaining legacyBehavior deprecation warnings in Link components
🐛 Issue Description
We're getting deprecation warnings for legacyBehavior in Next.js Link components throughout the codebase. This attribute is deprecated and will be removed in a future Next.js release.
⚠️ Current Warnings
`legacyBehavior` is deprecated and will be removed in a future release. A codemod is available to upgrade your components:
npx @next/codemod@latest new-link .
Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components
📍 Affected Files
Based on a search through the codebase, the following files still contain legacyBehavior:
src/app/(blog)/blog/(post)/[slug]/page.tsx
src/components/sections/hero.tsx
src/components/sections/shipping-velocity-client.tsx
src/components/sections/main-features.tsx
src/components/blog-author.tsx
src/components/prismui/timeline.tsx
src/components/blog-card.tsx
src/components/drawer.tsx
src/components/docs/table-of-contents.tsx
src/components/blog/mdx.tsx
src/components/blog/blog-card.tsx
src/components/blog/category-card.tsx
src/components/blog/logos.tsx
src/components/blog/blog-layout-hero.tsx
src/components/blog/author.tsx
src/components/blog/table-of-contents.tsx
src/components/blog/integrations.tsx
src/components/blog/customers.tsx
src/components/docs-nav.tsx
src/components/sidebar-nav.tsx
src/registry/section/pricing.tsx
src/registry/example/pricing-basic.tsx
🔧 Solution
Option 1: Run the official codemod (Recommended)
npx @next/codemod@latest new-link .
Option 2: Manual fixes
Remove legacyBehavior from Link components. For components with multiple children, ensure proper structure:
Before:
<Link href="/example" legacyBehavior>
<span>Title</span>
<div>Content</div>
</Link>
After:
<Link href="/example">
<span>Title</span>
<div>Content</div>
</Link>
✅ Acceptance Criteria
🔍 How to Test
- Run the development server:
pnpm dev
- Navigate through the site (docs, blog, components)
- Check browser console for deprecation warnings
- Verify all links work correctly
- Test registry components installation
📚 Additional Context
- Next.js introduced this deprecation to simplify Link component usage
- The new Link component can handle multiple children without
legacyBehavior
- Some components may need registry rebuilding after changes
- This affects both main components and registry exports
🎯 Priority
Medium - While not breaking functionality now, this will become a breaking change in future Next.js versions.
Environment:
- Next.js: 15.4.1
- React: 18.3.1
- Node.js: 20.x
Fix remaining
legacyBehaviordeprecation warnings in Link components🐛 Issue Description
We're getting deprecation warnings for
legacyBehaviorin Next.js Link components throughout the codebase. This attribute is deprecated and will be removed in a future Next.js release.📍 Affected Files
Based on a search through the codebase, the following files still contain
legacyBehavior:src/app/(blog)/blog/(post)/[slug]/page.tsxsrc/components/sections/hero.tsxsrc/components/sections/shipping-velocity-client.tsxsrc/components/sections/main-features.tsxsrc/components/blog-author.tsxsrc/components/prismui/timeline.tsxsrc/components/blog-card.tsxsrc/components/drawer.tsxsrc/components/docs/table-of-contents.tsxsrc/components/blog/mdx.tsxsrc/components/blog/blog-card.tsxsrc/components/blog/category-card.tsxsrc/components/blog/logos.tsxsrc/components/blog/blog-layout-hero.tsxsrc/components/blog/author.tsxsrc/components/blog/table-of-contents.tsxsrc/components/blog/integrations.tsxsrc/components/blog/customers.tsxsrc/components/docs-nav.tsxsrc/components/sidebar-nav.tsxsrc/registry/section/pricing.tsxsrc/registry/example/pricing-basic.tsx🔧 Solution
Option 1: Run the official codemod (Recommended)
npx @next/codemod@latest new-link .Option 2: Manual fixes
Remove
legacyBehaviorfrom Link components. For components with multiple children, ensure proper structure:Before:
After:
✅ Acceptance Criteria
legacyBehaviorattributes removed from Link componentspnpm build:registry)🔍 How to Test
pnpm dev📚 Additional Context
legacyBehavior🎯 Priority
Medium - While not breaking functionality now, this will become a breaking change in future Next.js versions.
Environment: