function useControlledReducer(
  reducer,
  props,
  createInitialState,
  isStateEqual,
) {
  const [state, dispatch] = useEnhancedReducer(
    reducer,
    props,
    createInitialState,
    isStateEqual,
  )

  return [getState(state, props), dispatch]
}
Wraps the useEnhancedReducer and applies the controlled prop values before
returning the new state.

@param {Function} reducer Reducer function from downshift.
@param {Object} props The hook props, also passed to createInitialState.
@param {Function} createInitialState Function that returns the initial state.
@param {Function} isStateEqual Function that checks if a previous state is equal to the next.
@returns {Array} An array with the state and an action dispatcher.