packageDocumentation module import * as React from "react" ; internal export function useRefEffect < T > ( callback , deps ) { const cleanup = React . useRef < ( ( ) => void ) | null > ( null ) ; return React . useCallback ( ( instance ) => { cleanup . current && cleanup . current ( ) ; const newCleanup = callback ( instance ) ; cleanup . current = ! newCleanup ? null : newCleanup ; } , deps ) ; }