Replies: 1 comment
-
There's also a video on this here: Server & Client Components. I think this could be helpful for you! But to answer the question: Hope this helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋
I was wondering if there’s a reason why next-intl doesn’t provide a
<T />
component out of the box?My use case:
getTranslations
can’t be used in client components, it will break when parent is a client component)useTranslations
, I need to add"use client"
at the top, which forces the entire component to become a client component—even though only a small part of it actually requires translation.Creating small client component works, but over time it leads to a large number of tiny components that only render text, which feels unnecessary.
To work around this, I wrote a
<T />
component myself. But I’m not sure if this is considered a bad practice or if there’s a specific reason why next-intl doesn’t support this pattern.Is there any guidance or best practice here?
Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions