How to use Redux-Form with React-Bootstrap?

后端 未结 2 1520
无人及你
无人及你 2021-02-08 05:27

I am trying to use \"redux-form\": \"^6.7.0\" with \"react-bootstrap\": \"^0.31.0\"

My Component renders nicely, but when I press Submit, what I see is an empty object.<

2条回答
  •  天命终不由人
    2021-02-08 05:42

    Some props required by are passed inside props.input from , see http://redux-form.com/6.6.3/docs/api/Field.md/#props

    To pass all those props in a generic way, instead of doing it explicitly, you can use the following function:

    const ReduxFormControl = ({input, meta, ...props}) => {
         return 
    };
    

    and then inside the form:

    
    

    This way, value, onChange, etc. are all passed as expected to .

提交回复
热议问题