Search code examples
reactjsreact-intl

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


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';

Solution

  • 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.