diff --git a/react-i18next/index.d.ts b/react-i18next/index.d.ts index 85c8e8851c..41daf14c4a 100644 --- a/react-i18next/index.d.ts +++ b/react-i18next/index.d.ts @@ -39,7 +39,7 @@ interface InterpolateProps { useDangerouslySetInnerHTML?: boolean; dangerouslySetInnerHTMLPartElement?: string; - [regexKey: string]: InterpolateValue | RegExp | I18next.TranslationOptions | boolean; + [regexKey: string]: InterpolateValue | RegExp | I18next.TranslationOptions | boolean | undefined; } export class Interpolate extends React.Component { } diff --git a/react-i18next/react-i18next-tests.tsx b/react-i18next/react-i18next-tests.tsx index 012f920bc9..fa2e36fcb1 100644 --- a/react-i18next/react-i18next-tests.tsx +++ b/react-i18next/react-i18next-tests.tsx @@ -26,7 +26,7 @@ interface InnerAnotherComponentProps { class InnerAnotherComponent extends React.Component { render() { - const { _ } = this.props; + const _ = this.props._!; return

{_('content.text', { /* options t options */ })}

; } @@ -41,7 +41,7 @@ interface InnerYetAnotherComponentProps extends InjectedTranslateProps { class InnerYetAnotherComponent extends React.Component { render() { - const { t } = this.props; + const t = this.props.t!; return

{t('usingDefaultNS', { /* options t options */ })}

; } @@ -55,7 +55,7 @@ interface TranslatableViewProps extends InjectedTranslateProps { @translate(['view', 'nav'], { wait: true }) class TranslatableView extends React.Component { render() { - const { t } = this.props; + const t = this.props.t!; let interpolateComponent = "a interpolated component"; diff --git a/react-i18next/tsconfig.json b/react-i18next/tsconfig.json index ba4f230166..b2109d366f 100644 --- a/react-i18next/tsconfig.json +++ b/react-i18next/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../"