react-nativereact-intlformatjs

react-intl become formatJs , how re-addlocaledata in react-native


I use react-intl for internationalization and in a component i get and set the locale-data like that :

import fr from 'react-intl/locale-data/fr';
import en from 'react-intl/locale-data/en';
...  
addLocaleData([...fr, ...en]);

But the library to migrate to formatJs and I don't see how to do the same with the new syntax or if I need to install something else.
If someone has an idea ??


Solution

  • This should fix your issue: https://formatjs.io/docs/react-intl/upgrade-guide-3x#migrate-to-using-native-intl-apis For react-native you'd need a bunch of polyfills from https://formatjs.io/docs/polyfills: