title: How to get selected row using ReactDataGrid?
body: <p>This is a very simple example of a ReactDataGrid component. I'm trying to get the selected row, but I am unsure of the syntax to get that out when calling my function.</p>
  <p>I don't think this is the correct syntax to call, <em>onSelectionChange</em> to print out the selected row. What is the correct syntax?
  <em>onSelectionChange={({ selected }) =&gt; this.onSelectionChange(selected)}</em></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { PropTypes, Component } from 'react';
  import ReactDataGrid from 'react-data-grid';
  
  class DataGridExample extends Component {
  
    static propTypes = {
      columns: PropTypes.array,
      rows: PropTypes.array
    };
  
    constructor (props) {
      super(props)
      this.state = {
        columns: [],
        rows: []
      }
      this.rowGetter = this.rowGetter.bind(this);
    }
  
    componentDidMount() {
      this.setState((prevState, props) =&gt; ({
        rows: [
          {key: 'd1', lname: 'Doe', quantity: 3},
          {key: 'd2', lname: 'Simmons', quantity: 97},
          {key: 'd3', lname: 'Walters', quantity: 6}
        ],
        columns: [
          {name: "Quantity", key: "quantity"},
          {name: "Last Name", key: "lname"}
        ]
      }));
    }
  
    rowGetter(i) {
      return this.state.rows[i];
    }
  
    onSelectionChange = (selected) =&gt; {
        console.log(`selected:${selected}`)
    }
  
    render() {
      return  (
      &lt;ReactDataGrid
        columns={this.state.columns}
        rowGetter={this.rowGetter}
        rowsCount={this.state.rows.length}
        minHeight={400} 
        onSelectionChange={({ selected }) =&gt; this.onSelectionChange(selected)}
        /&gt;);
    }
  }
  
  export default DataGridExample;</code></pre>
  </div>
  </div>
  </p>