I\'m wrapping my app inside an IntlProvider
from react-intl
v2, like this:
We encountered the same issue when combining react-relay
with redux-form
. The solution was simple: we initialize the form when the form is mounted.
compose(
createContainer({
fragments: {
viewer: () => Relay.QL`
fragment on User {
nickname
email
}
`
}
}),
reduxForm({
form: "user",
fields: ["nickname", "email"],
})
)(
class UserForm extends Component {
componentWillMount() {
this.props.initializeForm(this.props.viewer)
}
render() {
// Same as before
}
}
)
Hmm... You are changing your initialValues
prop, so it's initializing the form data. initialValues
is intended to be used for canonical data from the server to be edited (e.g. a loaded record), not really for updating individual form values from outside the component.
Perhaps you could use the plugin() API to notice the language change action (is that being changed via Redux?) and update the lang
value in your form?