I'm trying to get formatjs setup for use with my app which uses react-intl, and i'm running into an issue when doing an extract using their CLI. I currently have custom components that embed the FormattedMessage
component inside of them, example:
<AppLabel title="section_title_name"/>
Inside of <AppLabel/>
it has <FormattedMessage id={this.props.title}.../>
which would provide the translation for the label.
Is it still possible for me to setup extractions for these different component names, if they're not using the id
attribute to hold the string to extract for translation?
You can do this.
yarn add -D babel-plugin-formatjs
In
.babelrc