Redux-Form initial values from

前端 未结 6 1063
名媛妹妹
名媛妹妹 2020-12-08 09:16

I\'m trying to fill the profile form with data from API. Unfortunately redux-form doesn\'t want to cooperate with me in this case. For some reason fields stays empty whateve

6条回答
  •  独厮守ぢ
    2020-12-08 10:04

    You need to add enableReinitialize: true as below.

    let InitializeFromStateForm = reduxForm({
        form: 'initializeFromState',
        enableReinitialize : true // this is needed!!
    })(UserEdit)
    

    If your initialValues prop gets updated, your form will update too.

提交回复
热议问题