# TypeError: this.props.actions.createUserSessionAction is not a function

**URL:** https://forum.kirupa.com/t/typeerror-this-props-actions-createusersessionaction-is-not-a-function/638325
**Category:** programming
**Created:** [June 4, 2018, 12:45pm UTC](https://forum.kirupa.com/t/typeerror-this-props-actions-createusersessionaction-is-not-a-function/638325 "2018-06-04T12:45:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![123411](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/123411/32/9133_2.png) [@123411](https://forum.kirupa.com/u/123411)
#### Post date: [June 4, 2018, 12:45pm UTC](https://forum.kirupa.com/t/typeerror-this-props-actions-createusersessionaction-is-not-a-function/638325/1 "2018-06-04T12:45:42Z")

</div>

Can someone help me and tell me what this error means and how i can solve this error ??

TypeError: this.props.actions.createUserSessionAction is not a function  
Login.createSession

```auto
  46 | this.displayMessage(null);
  47 | 
  48 | this.setState(Object.assign({}, this.state, {loggingIn: true}));
> 49 | this.props.actions.createUserSessionAction(this.state.session);
  50 | }
  51 | 
  52 | componentWillReceiveProps(nextProps) {
View compiled
onClick

  102 | </div>
  103 | </div>
  104 | </div>
> 105 | <input id="button" className="button3 login" type="button" disabled={this.state.loggingIn} value="Login" onClick={() => this.createSession()}/>
  106 | </div>

```

**Here is the code for createSession() method**

```auto
createSession() {
    if (!this.state.session.name || this.state.session.name == '') {
      this.displayMessage('Username not supplied', 'ERROR');
      return;
    }

    if (!this.state.session.password || this.state.session.password == '') {
      this.displayMessage('Password not supplied', 'ERROR');
      return;
    }

   this.displayMessage(null);

    this.setState(Object.assign({}, this.state, {loggingIn: true}));
    this.props.actions.createUserSessionAction(this.state.session);
  }

```

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [June 4, 2018, 4:14pm UTC](https://forum.kirupa.com/t/typeerror-this-props-actions-createusersessionaction-is-not-a-function/638325/2 "2018-06-04T16:14:11Z")

</div>

You’re trying to call something as a function that doesn’t exist or is not a function. Where is `createUserSessionAction` defined? Where is `actions` getting set?
