UNPKG

@nexcodepl/store-react

Version:
9 lines (8 loc) 199 B
import { useRef } from "react"; export function useRefStatic(staticValue) { const ref = useRef(null); if (ref.current === null) { ref.current = staticValue(); } return ref; }