React-intl for non components
问题 Currently I have the following code to expose react-intl to non-components, but it throws an error for intl as undefined. I have created a separate component as 'CurrentLocale' and inject-intl to it. The exporting function t will use intl formatMessage from CurrentLocale context. import React from 'react'; import {injectIntl} from 'react-intl'; import PropTypes from 'prop-types'; import { flow } from 'lodash'; class CurrentLocale extends React.Component { constructor(props,context){ super();