I had previously asked a [question](https://stackoverflow.com/questions/39992000/how-do-i-use-local-state-along-with-redux-store-state-in-the-same-react-componen?noredirect=1#comment67263198_39992000) on react component state working in conjunction with Redux state. The first chain of code below is my original proposal for solving the issue, and the 2nd is an answer I got suggesting that I don't make a duplicate of the redux state. Is this because it's slow to make a duplicate? And it's faster to just store as less as possible in the local state and then the JS take care of the sorting?

On a related note, it feels weird that the 2nd chain of code requires me to always use functions that will return objects. Is this the only way to go? I know that in `React.createClass` you can store variables to hold objects and such, but with es6's extend component version, seems like you must use functions. Is there a way around this or is that just the way it is?

```
const Table = React.createClass({
  getInitialState () {
    return {contacts: []}
  },
  componentWillReceiveProps () {
    this.setState({ contacts: this.props.data.contacts})
  },
  sortContacts (parameter, e){
    ...
  },
  render () {
    return (
      <table>
        <thead>
          <tr>
            <th onClick={this.sortContacts.bind(this, "firstName")}>First Name</th>
          </tr>
        </thead>
        <tbody>
          {contactRows}
        </tbody>
      </table>
    )
  }
})

```

vs. 

```
const Table extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      sortBy: 'id' // default sort param
    }
  }

  sortContacts(param) {
    this.setState({ sortBy: param})
  }

  sortedContacts() {
    return this.props.contacts.sort(...); // return sorted collection
  }

  render() {
    return (
      <table>
        <thead>
          <tr>
            <th onClick={() => this.sortContacts("firstName")}>First Name</th>
          </tr>
        </thead>
        <tbody>
          {this.sortedContacts()}
        </tbody>
      </table>
    )
  }
}

```