This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Cannot retrieve Link's props from createLocalizedPathnamesNavigation #1250
Labels
You can continue the conversation there. Go to discussion →
Description
Hello everyone,
I need a
<Link />
component with special things (like analytics 👻 ), so I figured that I should create another link let's say<LinkWithAnalytics />
that would forward ref to<Link />
.Let's keep it simple :
So I just tried to check what is inside
typeof Link
and it's a bit hard to read but eventually result in{}
.It mostly related to HOW this is typed, because when used directly the Link have the correct props AND typed
href
frompathnames
.And we're not safe from an error on my part 🤭
If I can be of any form of help do not hesitate to reach out!
Kind regards 😄
Verifications
Mandatory reproduction URL
https://github.com/JulienRst/next-intl-bug-repro-app-router
Reproduction description
navigation.ts
and acknowledge the uses ofcreateLocalizedPathnamesNavigation
analytics-link.tsx
and acknowledge the errorExpected behaviour
As I was working with
createSharedPathnamesNavigation
before, I would expect thattypeof Link
give us the same props (with the href typed frompathnames
) than thetypeof Link
fromcreateSharedPathnamesNavigation
.The text was updated successfully, but these errors were encountered: