How to use react-i18next - 10 common examples

To help you get started, we’ve selected a few react-i18next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.62.x-0.63.x / test_react-i18next_v7.x.x.js View on Github external
it("errors if passed an argument", () => {
      // $ExpectError - no arguments should be passed to getI18n
      getI18n("string");
    });
  });
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.62.x-0.63.x / test_react-i18next_v7.x.x.js View on Github external
it("errors if passed a non-object", () => {
      // $ExpectError - i18n object should be passed to setI18n
      setI18n("string");
    });
  });
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.62.x-0.63.x / test_react-i18next_v7.x.x.js View on Github external
it("errors if passed an argument", () => {
      // $ExpectError - no arguments should be passed to getDefaults
      getDefaults("string");
    });
  });
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.53.x-0.61.x / test_react-i18next_v7.x.x.js View on Github external
reactI18nextModule.init(i18n);
reactI18nextModule.type;
// $ExpectError - no field property on reactI18nextModule
reactI18nextModule.field;

// passing
setDefaults({ wait: true });
// $ExpectError - setDefaults must be called with an object
setDefaults("option");
// $ExpectError - other is not a valid option
setDefaults({ other: true });

// passing
getDefaults();
// $ExpectError - no arguments should be passed to getDefaults
getDefaults("string");

// passing
getI18n();
// $ExpectError - no arguments should be passed to getI18n
getI18n("string");

// passing
setI18n(i18n);
// $ExpectError - setI18n must be called with an object
setI18n("option");
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.62.x-0.63.x / test_react-i18next_v7.x.x.js View on Github external
it("raises error when called with incorrect arguments", () => {
      // $ExpectError - too few arguments
      loadNamespaces();
      // $ExpectError - wrong type
      loadNamespaces("");
      // $ExpectError - wrong components type
      loadNamespaces({ components: [{}], i18n });
    });
  });
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.62.x-0.63.x / test_react-i18next_v7.x.x.js View on Github external
it("errors if trying to access an unknown property", () => {
      // $ExpectError - no field property on reactI18nextModule
      reactI18nextModule.field;
    });
  });
github flow-typed / flow-typed / definitions / npm / react-i18next_v6.x.x / test_react-i18next_v6.x.x.js View on Github external
// $ExpectError - i18nKey prop wrong type
;

// passing
;
;
;

// $ExpectError - i18nKey prop wrong type
;

// passing
reactI18nextModule.init(i18n);
reactI18nextModule.type;
// $ExpectError - no field property on reactI18nextModule
reactI18nextModule.field;

// passing
defaultOptions.wait;
defaultOptions.withRef;
defaultOptions.bindI18n;
defaultOptions.bindStore;
defaultOptions.translateFuncName;
defaultOptions.nsMode;
// $ExpectError - no field property on defaultOptions
defaultOptions.field;

// passing
setDefaults({ wait: true });
// $ExpectError - setDefaults must be called with an object
setDefaults("option");
// $ExpectError - other is not a valid option
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.53.x-0.61.x / test_react-i18next_v7.x.x.js View on Github external
// $ExpectError - i18nKey prop wrong type
;

// passing
;
;
;

// $ExpectError - i18nKey prop wrong type
;

// passing
reactI18nextModule.init(i18n);
reactI18nextModule.type;
// $ExpectError - no field property on reactI18nextModule
reactI18nextModule.field;

// passing
setDefaults({ wait: true });
// $ExpectError - setDefaults must be called with an object
setDefaults("option");
// $ExpectError - other is not a valid option
setDefaults({ other: true });

// passing
getDefaults();
// $ExpectError - no arguments should be passed to getDefaults
getDefaults("string");

// passing
getI18n();
// $ExpectError - no arguments should be passed to getI18n
github flow-typed / flow-typed / definitions / npm / react-i18next_v7.x.x / flow_v0.53.x-0.61.x / test_react-i18next_v7.x.x.js View on Github external
useDangerouslySetInnerHTML={true}
/>;

// $ExpectError - i18nKey prop wrong type
;

// passing
;
;
;

// $ExpectError - i18nKey prop wrong type
;

// passing
reactI18nextModule.init(i18n);
reactI18nextModule.type;
// $ExpectError - no field property on reactI18nextModule
reactI18nextModule.field;

// passing
setDefaults({ wait: true });
// $ExpectError - setDefaults must be called with an object
setDefaults("option");
// $ExpectError - other is not a valid option
setDefaults({ other: true });

// passing
getDefaults();
// $ExpectError - no arguments should be passed to getDefaults
getDefaults("string");
github flow-typed / flow-typed / definitions / npm / react-i18next_v6.x.x / test_react-i18next_v6.x.x.js View on Github external
useDangerouslySetInnerHTML={true}
/>;

// $ExpectError - i18nKey prop wrong type
;

// passing
;
;
;

// $ExpectError - i18nKey prop wrong type
;

// passing
reactI18nextModule.init(i18n);
reactI18nextModule.type;
// $ExpectError - no field property on reactI18nextModule
reactI18nextModule.field;

// passing
defaultOptions.wait;
defaultOptions.withRef;
defaultOptions.bindI18n;
defaultOptions.bindStore;
defaultOptions.translateFuncName;
defaultOptions.nsMode;
// $ExpectError - no field property on defaultOptions
defaultOptions.field;

// passing
setDefaults({ wait: true });