title: Uncaught TypeError: _this2.props.selectBook is not a function
body: <p>im a newbie for reactjs and was following a react basic course on udemy.
  I get the following error on my console log. Can anybody assist with me?.</p>
  
  <pre><code>bundle.js:21818 Uncaught TypeError: _this2.props.selectBook is not a function
  </code></pre>
  
  <p>Any help would be appreciated. Thanks.</p>
  
  <p><strong>containers/book-list.js</strong></p>
  
  <pre><code>import React, { Component } from 'react';
  import { connect } from 'react-redux';
  import { selectBook } from '../actions/index';
  import { bindActionCreators } from 'redux';
  
  class BookList extends Component {
      renderList() {
          return this.props.books.map((book) =&gt; {
              return (
                  &lt;li 
                      key={book.title} 
                      onClick={() =&gt; this.props.selectBook(book)} 
                      className="list-group-item"&gt;
                      {book.title}
                  &lt;/li&gt;
              );
          });
      }
  
      render() {
          return (
              &lt;ul className="list-group col-sm-4"&gt;
                  {this.renderList()}
              &lt;/ul&gt;
          )
      }
  }
  
  
  function mapStateToProps(state) {
      return {
          books: state.books
      };
  }
  
  //Anythin returned from this function will end up as props
  // on the BookList container
  function mapDispatchToProps(dispatch) {
      // whenever selectBook is called, the result should be passed
      // to all of our reducers
      return bindActionCreators({ selectBook: selectBook }, dispatch);
  }
  
  // Promote BookList from a component to a container - it needs to know 
  // about this new dispatch method, selectBook. Make it available
  // as a prop.
  export default connect(mapStateToProps)(BookList);
  </code></pre>
  
  <p><strong>actions/index.js</strong></p>
  
  <pre><code>export function selectBook(book) {
      console.log('A book has been selected:', book.title);
  }
  </code></pre>
  
  <p><strong>components/app.js</strong></p>
  
  <pre><code>import React, { Component } from 'react';
  
  import BookList from '../containers/book-list';
  
  export default class App extends Component {
    render() {
      return (
        &lt;div&gt;
          &lt;BookList /&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>