Why can I use useTranslations hooks from 'next-intl' package on server components?

184 Views Asked by At

I am trying to use next.js app router with next-intl package. On next-intl document, they show a example that use hooks on server components.

https://next-intl-docs.vercel.app/docs/environments/server-client-components

I have been known that I can't use hooks on server components, but how can I use useTranslations on server components. I saw next-intl's source code, but they use 'useMemo' and 'useContext' inside useTranslations.

What is different point between normal hooks like 'useState' or 'useEffect' and 'useTranslations' from 'next-intl'?

0

There are 0 best solutions below