Open votrungquan1999 opened 4 days ago
There's a note on this in the docs: How can I use “self-closing” tags without any chunks?.
This currently has some benefits related to upcoming type-safety of ICU args in the upcoming next-intl@4.0
. If we'd accept ReactNode
, this would for example also allow number
, therefore defeating number formatting validation.
Due to this, I think it's not worth it changing this behavior for the time being.
Description
When using
t.rich
for rich text format, I see that I can useJSX.Element
for the value, which displays correctly. However, the typescript gave me the error.I think the library used under the hood also supports
JSX.Element
when formatting rich text. we could improve the typing here.Another issue is that in the server component that renders the formatted key, this error happens
Verifications
Mandatory reproduction URL
https://github.com/votrungquan1999/reproduce-next-intl-typing
Reproduction description
Seconds
component is rendered by thet.rich
https://github.com/user-attachments/assets/fe348f0e-a894-42d6-a08c-194f0769055b
Expected behaviour