....
const func1 = (intl) => {
const text = intl.formatMessage({id: 'mesage'});
const func2 = () => {
return {
<div>.....
placeholder={text}</div>
};
};
return {
<div>.....
{func2()}</div>
};
};
export default withStyles(styles)(injectIntl(component));`}
I'm trying to to injectIntl to translate strings using react-intl library, but I keep getting following error:
"Cannot read property 'formatMessage' of undefined"
I am trying to do something like this: React-Intl How to use FormattedMessage in input placeholder