mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Made react-i18next typings compatible with strictNullChecks
This commit is contained in:
parent
47feec0e12
commit
79eec0c2f3
2
react-i18next/index.d.ts
vendored
2
react-i18next/index.d.ts
vendored
@ -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<InterpolateProps, {}> { }
|
||||
|
||||
@ -26,7 +26,7 @@ interface InnerAnotherComponentProps {
|
||||
|
||||
class InnerAnotherComponent extends React.Component<InnerAnotherComponentProps, {}> {
|
||||
render() {
|
||||
const { _ } = this.props;
|
||||
const _ = this.props._!;
|
||||
|
||||
return <p>{_('content.text', { /* options t options */ })}</p>;
|
||||
}
|
||||
@ -41,7 +41,7 @@ interface InnerYetAnotherComponentProps extends InjectedTranslateProps {
|
||||
|
||||
class InnerYetAnotherComponent extends React.Component<InnerYetAnotherComponentProps, {}> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
const t = this.props.t!;
|
||||
|
||||
return <p>{t('usingDefaultNS', { /* options t options */ })}</p>;
|
||||
}
|
||||
@ -55,7 +55,7 @@ interface TranslatableViewProps extends InjectedTranslateProps {
|
||||
@translate(['view', 'nav'], { wait: true })
|
||||
class TranslatableView extends React.Component<TranslatableViewProps, {}> {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
const t = this.props.t!;
|
||||
|
||||
let interpolateComponent = <strong>"a interpolated component"</strong>;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user