import { useState as a, useRef as u, useCallback as r } from "react";
function l(f) {
  const [o, s] = a(f), t = u(null), n = r((e) => {
    e && t.current !== e && (t.current = e, s(e));
  }, []);
  return [o, n];
}
export {
  l as useStateRef
};
