redux-form : How to display form values on another component

前端 未结 4 1051
小蘑菇
小蘑菇 2021-01-13 00:34

I am using redux-form 6.0.0-rc.5 and I am trying to display the form values as they are entered by the user.

However, I want these values to be displayed from anothe

4条回答
  •  迷失自我
    2021-01-13 01:07

    formValueSelector() is not necessary.

    You also can directly access it as a property.

    List = connect(
      state => ({
        formValues: {
           id: state.form.formName.values.id
        }
      })
    )(List)
    

    Same as

    List = connect(
      state => ({
        formValues: {
           id: formValueSelector('formName')(state, 'id')
        }
      })
    )(List)
    

提交回复
热议问题