You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Our project is fairly huge and already contains wrapped components by one another so we really do not want to use InjectIntl() to wrap class components to use formatting API (it also breaks some tests as well).
Describe the solution you'd like
It would be great if we could just import intl from 'react-intl' and "intl.API" to call the API ( like intl.formatMessage) OR
Is there any way to call Formatting API without using InjectIntl() for class components? possibly with createIntl()?
Describe alternatives you've considered
At least simpler and less complicated way to use formatting API in class components
Additional context
This complexity of InjectIntl() makes it very to use React Intl in a big project. We are about to use other libraries just because we do not want to use InjectIntl(), but the rest of the library and related babel-plugins are very good so if possible I would like to keep using React-Intl.
The text was updated successfully, but these errors were encountered:
We do export IntlContext so technically you can get the Consumer out of that. Would that work for you?
The intl object from react-intl is a cached instance of several thing, including locale so it's not something we can export out statically. That falls on the user land.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is your feature request related to a problem? Please describe.
Our project is fairly huge and already contains wrapped components by one another so we really do not want to use InjectIntl() to wrap class components to use formatting API (it also breaks some tests as well).
Describe the solution you'd like
It would be great if we could just import intl from 'react-intl' and "intl.API" to call the API ( like intl.formatMessage)
OR
Is there any way to call Formatting API without using InjectIntl() for class components? possibly with createIntl()?
Describe alternatives you've considered
At least simpler and less complicated way to use formatting API in class components
Additional context
This complexity of InjectIntl() makes it very to use React Intl in a big project. We are about to use other libraries just because we do not want to use InjectIntl(), but the rest of the library and related babel-plugins are very good so if possible I would like to keep using React-Intl.
The text was updated successfully, but these errors were encountered: