akameco / babel-plugin-react-intl-auto

i18n for the component age. Auto management react-intl ID.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add useKey support to intl.formatMessage

fsmaia opened this issue · comments

  • version: 2.3.0
  • node version: 10.16.1
  • npm (or yarn) version: 6.9.0

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

What is the current behavior?:
key prop is supported only in <FormattedMessage /> and <FormattedHTMLMessage /> when using useKey option

What is the expected behavior?:
key property could be supported in formatMessage too, e.g.:

props.intl.formatMessage({
  key: 'key'
});

Suggested solution:
Update addIdToFormatMessage visitor to support key property nodePath.

I have the exact same issue!

Done ✅ Install the latest version 🚀