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

Ids are missing if the FormattedMessage uses the same defaultMessage #125

Open
scottdickerson opened this issue Apr 7, 2020 · 0 comments

Comments

@scottdickerson
Copy link

scottdickerson commented Apr 7, 2020

  • version: 3.3.0
  • node version:
  • npm (or yarn) version:

Do you want to request a feature or report a bug?:
Bug

What is the current behavior?:
For FormattedMessage if the FormattedMessage is placed directly inside a span, the ID fails to generate for the second component and react-intl will throw the invariant missing ID message when the component is rendered.

This should reproduce the error

<span>
<FormattedMessage defaultMessage='Hi There' />
</span>

What is the expected behavior?:
All FormattedMessages would successfully generate an ID

Suggested solution:
I've worked around this by hardcoding an id in the specific messages that were failing to generate an ID or by using

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

1 participant