score:0

you are importing {createuser} and trying to use {createuser} in the container.jsx file.

score:0

you need to use mapdispatchtoprops instead of matchdispatchtoprops and also use createuser in you mapdispatchtoprops function since you imported it as createuser

class createusercontainer extends component{

    constructor(props) {
        super(props);
    }
    componentdidmount(){

    }
    render (){
        return(
            <logincomponent createuser={this.props.createuser} />
        )
    }
}

function mapdispatchtoprops(dispatch){
    return bindactioncreators({
        createuser:createuser
    }, dispatch)
}

also your class must implement the constructor to inherit the props

one more thing is that your handlesubmit function in logincomponent is not bound

class  logincomponent extends component{
  constructor(props) {
    super(props);
    this.handlesubmit = this.handlesubmit.bind(this);
  }

you can also try and console.log(this.props) in your logincomponent to see if it receives the createuser function


Related Query

More Query from same tag