-
-
Notifications
You must be signed in to change notification settings - Fork 247
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs]: Update Typescript Integration docs #950
Comments
This is currently not supported by design: #92 Can you solve your problem with something like this? const t = useTranslations('Global');
function getLabel(key: 'key1' | 'key2' | …) {
return t(key);
}
<BrickRenderer getLabel={getLabel} /> |
I expressed myself incorrectly i guess.
And now for example i want to pass down the t() function with the key "Global" to the component renderer (brick renderer). Only someKey should be shown. I hope i expressed my self this time better :) |
That's because this type doesn't work as expected: export type Translations = Awaited<ReturnType<typeof getTranslations>>; The reason why passing the If Can you tell me a bit more about your I understand that this constraint on the usage of I'll move this to a discussion for the time being, since this is currently working as expected. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Link to page
https://next-intl-docs.vercel.app/docs/workflows/typescript
Describe the problem
My problem is following: I want to pass down the translation function as a prop, but i don't know how to achieve the type of it.
Thats my type i created so far:
This works but only if i have one key in my messages.json. If i have multiple keys it doesn't work.
I put it under docs, because i hoped that i will find a way to achieve this by reading the docs.
The text was updated successfully, but these errors were encountered: