Quantcast
Viewing all articles
Browse latest Browse all 6405

i18n-js Property 't' does not exist on type 'typeof import'

I installed the i18n-js library in a react-native project, and I got a problem with typescript.

I use the library this way:

i18n.js

import i18n from 'i18n-js';import en from './locales/en.json';import es from './locales/es.json';i18n.defaultLocale = 'en';i18n.locale = 'en';i18n.fallbacks = true;i18n.translations = {en, es};export default i18n;

Auth.tsx

import i18n from '../../i18n';...Alert.alert(i18n.t('login.accountCreatedTitle'));

I got this annoying Typescript error:

Image may be NSFW.
Clik here to view.
enter image description here

How can i solve that?


Viewing all articles
Browse latest Browse all 6405

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>