react-intl.macro icon indicating copy to clipboard operation
react-intl.macro copied to clipboard

FormattedMessage error when using it as a parent component

Open arvinsim opened this issue 6 years ago • 5 comments
trafficstars

I am using this approach as outlined in some of the answers in here

<FormattedMessage
  ....
>
  {placeholder => <input placeholder={placeholder} />}
</FormattedMessage>

However, I get this error when trying to extract the message strings

TypeError: react-intl.macro: referencePath.parentPath.get(...).filter is not a function Learn more: https://www.npmjs.com/package/react-intl.macro at Array.map (<anonymous>)

arvinsim avatar Mar 15 '19 03:03 arvinsim

Knock Knock :) I am having the same issue, cannot extract messages when using a render prop pattern. Anyone has any clue how to solve this ?

Raysharr avatar Jun 10 '19 07:06 Raysharr

I have the same issue when I do:

const info = {
  name: (
      <FormattedMessage
        id="app.name"
        defaultMessage="Your name"
      />
    ),
}

woile avatar Jun 19 '19 19:06 woile

I have same issue. Is there anyone resolved this?

thudaohd avatar Jan 16 '20 01:01 thudaohd

Any updates on this?

arvinsim avatar Mar 09 '20 03:03 arvinsim

I solved this problem by combining using defineMessages of react-intl.macro and injectInt of react-int.

thudaohd avatar Mar 09 '20 04:03 thudaohd