This is similar to #33, I am trying to use react-intl components for translating the form labels, but the issue will happen for any react element:
<Input
name="testInput"
label={
<FormattedMessage
id="testInput.label"
defaultMessage="Test label"
/>
}
/>
This issue is caused by the JSON.stringify(label) in the component.getId mixin
I have a few ideas around fixing this, but not sure the best approach to take:
- Only try and hash label if
React.isValidElement returns false
- Dont include the label when generating the id.
- Require input label prop type to be string, use alternate method to get translation.
It would be nice if we could generate a unique id for each Formsy.Form component, then hashing the label wouldnt be necessary. Was thinking we could maybe opt into this using the parent context mixin.
This is similar to #33, I am trying to use react-intl components for translating the form labels, but the issue will happen for any react element:
This issue is caused by the
JSON.stringify(label)in the component.getId mixinI have a few ideas around fixing this, but not sure the best approach to take:
React.isValidElementreturnsfalseIt would be nice if we could generate a unique id for each
Formsy.Formcomponent, then hashing the label wouldnt be necessary. Was thinking we could maybe opt into this using the parent context mixin.