Attempted import error: 'addLocaleData' is not exported from 'react-intl'

Chi Bui picture Chi Bui · Aug 13, 2019 · Viewed 10.5k times · Source

It's return error when i try this code

react-intl version 3.1.6 && react version 16.9

import { IntlProvider, FormattedMessage , addLocaleData} from 'react-intl';

Answer

Brian picture Brian · Aug 14, 2019

I'm still investigating but it looks like addLocaleData was removed as a breaking change for v3.

https://formatjs.io/docs/react-intl/upgrade-guide-3x

This was a bit confusing for me too because a lot of the tutorials and guides out there still use addLocaleData.