score:0

i solve the problem, when use form component, don't input props. for example:

@reduxform({
    form: 'demo'
})
class demo extends component {
    render () {
        return (
            <form>
                <field component="input" label="name" name="name"></field>
            </form>
        );
    }
}

class container extends component {
    render() {
        return (<demo {...this.props}></demo>); // !!==> remove this.props.
    }
}

the reason will be complete later... i will find.

score:0

seconding honpery's answer to their own question and expanding upon it a little bit. it appears that if you pass a prop to your form component named 'form', it gets all confused.

so, for example:

<contactform
   form={this.props.form}
/>

is going to end in sadness. changing it to:

 <contactform 
    formdetails={this.props.form}
 />

gets rid of that weird error/issue.

score:1

you get this error, because reduxform expects to receive a settings object with form: "string" where string is your form name. according to the error, you passed an object to the form attribute in your settings, e.g. form: { ... }. if you can show your form code i could point to an exact fix.

score:1

@deividas karžinauskas had it right, but his answer wasn't accepted for some reason. setting form: {...} to an object instead of a string is where the problem is occurring. removing it for me got rid of the error. for a more hands on example:

erroneous code:

export default connect(
  state => ({ ...state.lotoperation, form: state.lotoperationform }),
  dispatch => bindactioncreators(actioncreators, dispatch))(lotoperationindex)

solution

export default connect(
  //notice here i'm not setting "form: {..}" to an object anymore.
  state => ({ ...state.lotoperation }),
  dispatch => bindactioncreators(actioncreators, dispatch))(lotoperationindex)

Related Query

More Query from same tag