1 import { useEffect, useState } from 'react';
4 * Same as setState with the difference being that the value
5 * passed in the argument of the hook is not only an initial
6 * value but will synchronize with the returned state should
7 * it change (pointer identity).
9 const useSynchronizingState = <V>(value: V) => {
10 const [state, setState] = useState<V>(value);
16 return [state, setState] as const;
19 export default useSynchronizingState;