Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormattedMessage error when using it as a parent component #73

Open
arvinsim opened this issue Mar 15, 2019 · 5 comments
Open

FormattedMessage error when using it as a parent component #73

arvinsim opened this issue Mar 15, 2019 · 5 comments

Comments

@arvinsim
Copy link

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>)

@Raysharr
Copy link

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 ?

@woile
Copy link

woile commented Jun 19, 2019

I have the same issue when I do:

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

@thudaohd
Copy link

I have same issue. Is there anyone resolved this?

@arvinsim
Copy link
Author

arvinsim commented Mar 9, 2020

Any updates on this?

@thudaohd
Copy link

thudaohd commented Mar 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants