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

前端 未结 4 1090
小蘑菇
小蘑菇 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:13

    Try using

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

    instead. At least that's how it worked in v5, although there the method was called getValues and not getFormValues.

    Edit: After a quick look at the docs it seems in v6 you'll have to use a formValueSelector: http://redux-form.com/6.0.0-rc.3/examples/selectingFormValues/

提交回复
热议问题