function createStateKeySetter(component, key) {
  // Partial state is allocated outside of the function closure so it can be
  // reused with every call, avoiding memory allocation when this function
  // is called.
  var partialState = {};
  return function stateKeySetter(value) {
    partialState[key] = value;
    component.setState(partialState);
  };
}
Returns a single-argument callback that can be used to update a single
key in the component's state.

Note: this is memoized function, which makes it inexpensive to call.

@param {ReactCompositeComponent} component
@param {string} key The key in the state that you should update.
@return {function} callback of 1 argument which calls setState() with
                   the provided keyName and callback argument.