title: Deleting an item in ReactJS
body: <p>I'm new to React and made an app that allows searches to be saved.  This will pull JSON but is currently pulling from a static array <code>data</code>.  I'm having trouble being able to delete searches from the search list.</p>
  
  <p>Here's the jsbin: <a href="http://jsbin.com/nobiqi/edit?js,output" rel="noreferrer">http://jsbin.com/nobiqi/edit?js,output</a></p>
  
  <p>Here's my delete button element:</p>
  
  <pre><code>var DeleteSearch = React.createClass({
    render: function() {
      return (
        &lt;button onClick="this.props.deleteSearchItem" value={index}&gt;&lt;i className="fa fa-times"&gt;&lt;/i&gt;
          &lt;/button&gt;
      );
    }
  });
  </code></pre>
  
  <p>and my function</p>
  
  <pre><code>  deleteSearchItem: function(e) {
      var searchItemIndex = parseInt(e.target.value, 10);
      console.log('remove task: %d', searchItemIndex);
      this.setState(state =&gt; {
          state.data.splice(searchItemIndex, 1);
          return { data: state.data };
      });
    }
  </code></pre>
  
  <p>I've tried following tutorials and I'm not sure where to go from here.  How can I delete the search items?</p>