UNPKG

@whop/react

Version:

React SDK for building embedded apps on Whop

10 lines (9 loc) 208 B
import { useRef } from "react"; const none = Symbol("none"); export function useLazyRef(fn) { const ref = useRef(none); if (ref.current === none) { ref.current = fn(); } return ref; }