mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-15 22:40:21 +00:00
Add tOptions prop to <Trans /> in react-i18next (#25089)
This commit is contained in:
committed by
Wesley Wigham
parent
b4ea50c7a9
commit
ba5f8c9912
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-i18next 7.3
|
||||
// Type definitions for react-i18next 7.6
|
||||
// Project: https://github.com/i18next/react-i18next
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Simon Baumann <https://github.com/chnoch>
|
||||
|
||||
Vendored
+5
@@ -1,12 +1,17 @@
|
||||
import * as React from "react";
|
||||
import { i18n, TranslationFunction } from "i18next";
|
||||
|
||||
export interface TOptions {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface TransProps {
|
||||
i18nKey?: string;
|
||||
count?: number;
|
||||
parent?: string;
|
||||
i18n?: i18n;
|
||||
t?: TranslationFunction;
|
||||
tOptions?: TOptions;
|
||||
}
|
||||
|
||||
export default class Trans extends React.Component<TransProps> { }
|
||||
|
||||
@@ -119,6 +119,7 @@ loadNamespaces({components: [App], i18n}).then(() => {
|
||||
<Trans count={5}>
|
||||
<App/>
|
||||
</Trans>;
|
||||
<Trans i18nKey="hello" tOptions={{hello: "world", count: 42}}/>;
|
||||
|
||||
type Key = "view" | "nav";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user