UNPKG

@chakra-ui/react

Version:

Responsive and accessible React UI components built with React and Emotion

14 lines (11 loc) 257 B
"use strict"; "use client"; import { useRef } from 'react'; function useConst(init) { const ref = useRef(null); if (ref.current === null) { ref.current = typeof init === "function" ? init() : init; } return ref.current; } export { useConst };