code: function useStateWithGetter(initial) {
    const ref = useRef();
    const [state, setState] = useState(initial);
    ref.current = state;
    const set = (value) => {
      ref.current = value;
      setState(value);
    };
    const get = () => {
      return ref.current;
    };
    return [state, set, get];
  }
docs: TODO figure out if this is bad? https://github.com/facebook/react/issues/14543