import { useRef , useEffect } from 'react' ; export function useInitEffect ( cb ) { const init = useRef ( false ) ; useEffect ( ( ) => { if ( ! init . current ) { cb ( ) ; init . current = true ; } } ) ; }