UNPKG

@cgi-learning-hub/ui

Version:

@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features

16 lines (15 loc) 307 B
import * as e from "react"; const c = typeof window < "u" ? e.useLayoutEffect : e.useEffect; function f(t) { const u = e.useRef(t); return c(() => { u.current = t; }), e.useRef((...n) => ( // @ts-expect-error hide `this` (0, u.current)(...n) )).current; } export { f as a, c as u };