Closed
Description
This is what is stated in the documentation, and works successfully:
const Component = () => {
return (
<div>
<T
keyName="translation_key"
params={{ i: <i /> }}
defaultValue="This is <i>formatted</i>"
/>
</div>
);
};
However, this gives a type error with the equivalent useTranslate
hook:
const { t } = useTranslate();
const result = t("translation_key", "This is <i>formatted</i>", { i: <i /> });
It seems that the DefaultParamType
does not accept JSX.Element
types:
export type DefaultParamType = string | number | bigint | Date;
Metadata
Metadata
Assignees
Labels
No labels