extract-hoc
extract-hoc copied to clipboard
Breaks react-intl defineMessages
This plugin seems to change unwanted functions, in my case defineMessages
from react-intl.
My app contains code like following.
const messages = defineMessages({
pageTitle: { id: 'App.pageTitle', defaultMessage: 'Page title' },
metaDescription: { id: 'App.metaDescription', defaultMessage: 'The description to be displayed in google search results' },
})
When I start my app I get following error.
ERROR in ./client/pages/App/App.js
Module build failed: SyntaxError: [React Intl] `defineMessages()` must be called with an object expression with values that are React Intl Message Descriptors, also defined as object expressions.
12 | import Dialog from '../../components/Dialog'
13 |
> 14 | const messages = defineMessages({
| ^
15 | pageTitle: { id: 'App.pageTitle', defaultMessage: 'Universal Relay Starter Kit' },
16 | metaDescription: { id: 'App.metaDescription', defaultMessage: 'The description to be displayed in google search results' },
17 | })
You can run this branch to reproduce the error.
This is very edge case, a PR for this is welcome.
We've encountered this problem as well. Is there a known workaround?