"use client";
import * as s from "react";
import { u as o } from "./useIsoLayoutEffect-DpJo20by.js";
import { u } from "./useStableCallback-CudqoENs.js";
function f(e, n) {
  const t = s.useRef(e), r = u(n);
  o(() => {
    t.current !== e && r(t.current);
  }, [e, r]), o(() => {
    t.current = e;
  }, [e]);
}
export {
  f as u
};
