-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trans shouldUnescape
prop is missing in .d.ts
#1428
Comments
Would you like to send a Pull Request to address this? Remember to add unit tests. |
I tried to override the react-i18next type: declare module "react-i18next" {
// add i18n translations type safty-https://stackoverflow.com/questions/58277973/how-to-type-check-i18n-dictionaries-with-typescript#answer-65348832
export function Trans<
K extends TFuncKey<N> extends infer A ? A : never,
N extends Namespace = DefaultNamespace,
E extends Element = HTMLDivElement
+ >(props: TransProps<K, N, E> & {
+ shouldUnescape?: boolean
+ }): React.ReactElement;
} And that silences the typescript error, import { Trans } from "react-i18next"
export function Example() {
return <Trans
shouldUnescape
defaults={"<p>Hello you</p>"} />
} characters like Do you see any mistake in my code? |
No, not at the moment :) |
@pedrodurek Can you help? |
@adrai, |
Thanks to @pedrodurek this should be fixed with v11.15.1. |
🐛 Bug Report
Based on the documentation for the
<Trans />
componenthttps://react.i18next.com/latest/trans-component#trans-props
There is a
shouldUnescape
prop,but that prop doesn't exist in the index.d.ts file,
so typescript complains
To Reproduce
Try to use the
shouldUnescape
prop on the Trans compoent.Expected behavior
No errors should be reported.
Your Environment
The text was updated successfully, but these errors were encountered: