Originally I had this call at `index.js` to trigger the load of my main data:

```
const store = configureStore();
store.dispatch(doStuff());

```

Now I want to do the next step and load this data at page level (seems better).

---

I'm basing myself on this post by Gaearon at the [Redux github](https://github.com/reactjs/redux/issues/916):

[![enter image description here](https://i.stack.imgur.com/vgPd6.png)](https://i.stack.imgur.com/vgPd6.png)

---

I have this code:

```
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { PropTypes } from 'prop-types';
import { bindActionCreators } from 'redux';
import * as myActions from '../../actions/myActions';
import { MuiThemeProvider } from 'material-ui/styles';

let createHandlers = function(dispatch) {
    let doStuff = function() {
      dispatch(myActions.doStuff())
    };

    return {
        doStuff,
      // other handlers
    };
  }

class MyPage extends Component {
    constructor(props, context) {
        super(props, context);

        this.handlers = createHandlers(this.props.dispatch);
        //this.handlers.doStuff();

        this.state = {
            myStuff: []
        }
    }

    render() {
        return (
            <MuiThemeProvider>
                <div>...</div>
            </MuiThemeProvider>
        );
    }
}

function mapStateToProps(state, ownProps) {
    return {
        // Set state
    };
}

function mapDispatchToProps(dispatch) {
    return {
        // Set state
    };
}

MyPage.propTypes = {
        // My props
}

export default connect(mapStateToProps, mapDispatchToProps)(MyPage);

```

---

**The issue**

When I uncomment the line, I get this error:

> 
> TypeError: dispatch is not a function
> 
> 
> 

```
let doStuff = function() {  
   dispatch(myActions.doStuff()) 
};

```

The (most important) difference that I see is that I do mapping:

```
export default connect(mapStateToProps, mapDispatchToProps)(MyPage);

```

What do I need to do to get this to work?

*Likely something easy, but I don't see it.*