UNPKG

@chakra-ui/hooks

Version:

React hooks for Chakra components

13 lines (10 loc) 243 B
'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 };