-
-
Notifications
You must be signed in to change notification settings - Fork 331
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Yes. When using next-intl with next-view-transitions, the Link components don't work together directly.
The problem is:
next-intl'sLinkuses locale-agnostic paths (e.g.,/about)next-view-transitions'Linkneeds locale-prefixed paths (e.g.,/en/about)
Currently, we need to:
- Create custom wrapper components
- Manually convert locale-aware hrefs to locale-prefixed URLs
- Handle edge cases (like root path
/→/en)
This is complex, error-prone, and breaks easily. There's already a discussion about this in the next-view-transitions repository, so it seems to be a common pain point.
Describe the solution you'd like
Add native support for next-view-transitions in next-intl so developers can use both libraries together seamlessly.
Option 1: Prop-based
import { Link } from '@/i18n/routing';
<Link href="/about" viewTransition>About</Link>Option 2: Config-based
export const routing = defineRouting({
locales: ['en', 'de'],
defaultLocale: 'en',
viewTransitions: true, // Enable globally
});This would make next-intl's Link automatically work with next-view-transitions when enabled, without needing custom wrappers.
Describe alternatives you've considered
- Custom wrapper components - This is what we're currently doing, but it's error-prone and requires maintenance
- Using
next-view-transitions'Linkdirectly - But this loses all the locale-aware routing benefits fromnext-intl - Manual href conversion - Complex and breaks easily, especially with edge cases like root paths
Having native support in next-intl would be the cleanest solution and provide the best developer experience.
Additional Context
next-intl: ^4.4.0next-view-transitions: ^0.3.4next: ^16.0.1react: ^19.2.0
Related Issues
- Related discussion in
next-view-transitions: #38 - How to use this api with next-intl navigation wrapper?
wadehammes