Skip to content

Commit

Permalink
add usage test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsogl committed Feb 7, 2019
1 parent 19fdfd4 commit 860d8d5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/typescript/I18nextProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import i18n from 'i18next';
import * as React from 'react';
import { I18nextProvider, initReactI18next } from 'react-i18next';

i18n.use(initReactI18next).init({
fallbackLng: 'en',

// have a common namespace used around the full app
ns: ['translations'],
defaultNS: 'translations',

debug: true,

interpolation: {
escapeValue: false, // not needed for react!!
},

react: {
wait: true,
},
});

function test() {
return (
<React.Suspense fallback={<p>Loading</p>}>
<I18nextProvider i18n={i18n}>
<h1>Foo</h1>
</I18nextProvider>
</React.Suspense>
);
}

0 comments on commit 860d8d5

Please # to comment.