babel-plugin-react-intl-auto
babel-plugin-react-intl-auto copied to clipboard
Ids are missing if the FormattedMessage uses the same defaultMessage
- version: 3.3.0
nodeversion:npm(oryarn) 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 <FormattedMessage tagName="span"/>