UNPKG

react-native-photos-gallery

Version:
17 lines 469 B
import { useEffect, useRef } from 'react'; const useForwardRef = (ref, initialValue = null) => { const targetRef = useRef(initialValue); useEffect(() => { if (!ref) return; if (typeof ref === 'function') { ref(targetRef.current); } else { ref.current = targetRef.current; } }, [ref]); return targetRef; }; export default useForwardRef; //# sourceMappingURL=useForwardRef.js.map