import { useEffect } from 'react' ; export function useFadeIn ( ref , duration = 1 , enable = true ) { useEffect ( ( ) => { if ( ref . current && enable ) { ref . current . style . transition = `opacity ${ duration }s ease-in` ; ref . current . style . opacity = '1' ; } } , [ ref , duration , enable ] ) ; return { style : { opacity : 0 } } ; }