title: Uncaught TypeError: this.props.onDelete is not a function reactjs
body: <blockquote>
    <p>The problem occurs when i'm trying to delete a to do list,onDelete is not a function.Full code is <a href="https://github.com/sajinrules/react-todo" rel="nofollow">here</a> in the git.Thanks</p>
  </blockquote>
  
  <pre><code>var TodoList = React.createClass({
      onDelete : function(key){
          console.log('remove here');
      },
      render: function() {
          var createItem = function(itemText,i) {
              return (
                  &lt;TodoListItem onDelete={this.remove} index={i} key=
                      {i}&gt;{itemText}
                  &lt;/TodoListItem&gt;
              );
          };
  
          return(
              &lt;ul id="staggered-test" className="collection with-
              header"&gt;
                  &lt;li className="collection-header"&gt;
                      &lt;h4&gt;todo list&lt;/h4&gt;
                      {this.props.items.map(createItem)}
                  &lt;/li&gt;
              &lt;/ul&gt;
        )
     }
  });
  
  
  
  
  var TodoListItem = React.createClass({
      remove : function(key){
          console.log('test:',key);
          console.log('that.props',this);
          this.props.onDelete();
      },
      render : function(){
          return(
              &lt;li className="collection-item"&gt;
                  &lt;div&gt;{this.props.children}
                      &lt;a onClick=
                      {this.remove.bind(this,this.props.index)} href="#" className="secondary-content"&gt;&lt;i className="material-icons"&gt;delete&lt;/i&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          )
      }
  });
  </code></pre>