I am working on a react application - and when a user inputs a text field - I want a button on the same row - to change from 'generate' to 'save'
<FormattedMessage
id='generate'
defaultMessage='Generate'
/>
but I want something like this
<FormattedMessage
id='generate'
defaultMessage={valueName ? 'Save' : 'Generate'}
/>
or something
<FormattedMessage
id='generate'
defaultMessage={valueName.length > 0 ? 'Save' : 'Generate'}
/>
but when I implement something like this I get the following error
"[React Intl] Messages must be statically evaluate-able for extraction."
https://github.com/formatjs/react-intl/blob/master/docs/Components.md#formattedmessage