Closed sawa-ko closed 1 year ago
Hey, as the error message states, you're liking missing the provider on the client side—please see https://next-intl-docs.vercel.app/docs/next-13. Also, please follow the issue template in the future and provide a CodeSandbox if you're seeing a bug. If you still see the error and have a reproduction, please open a new issue. Thanks!
@amannn So, do I need to put the client provider in each component with "use client"?
It depends. If you don't mind to pass all messages to the client, you can set up the provider at a central place and provide all messages: https://next-intl-docs.vercel.app/docs/next-13/client-components
I'm sorry, I didn't understand, in the link you send me it says I have to use the client provider, which is the same thing I said in my question, so you mean what I said I have to do?
Ultimately you have to use NextIntlClientProvider
, either once globally, or individually for selected components.
Description
You get an error when using the hook useTranslations inside a client component that is inside a server component.
Reproduction
Steps to reproduce:
Expected behaviour
No error about not being able to obtain the context. This happens only when using the components in this way.