amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

Passing a React.Node into t.rich #1406

Closed rrrshtt closed 1 month ago

rrrshtt commented 1 month ago

Is your feature request related to a problem? Please describe.

I want to pass an React.Node into some 'destination' key without chunks.

Describe the solution you'd like

For some reasons this usage is work perfectly. I just passed a key into node.

t.rich('message', {
  destination: (<span key="destination">Hello destination</span>) as unknown as string,
});

Describe alternatives you've considered

i will write it down later, didn't saw next-intl code yet.

amannn commented 1 month ago

Please refer to the docs: https://next-intl-docs.vercel.app/docs/usage/messages#rich-text-self-closing