Similar to usePresence, except useIsPresent simply returns whether or not the component is present. There is no safeToRemove function.
usePresence
useIsPresent
safeToRemove
import { useIsPresent } from "framer-motion"export const Component = () => { const isPresent = useIsPresent() useEffect(() => { !isPresent && console.log("I've been removed!") }, [isPresent]) return <div />} Copy
import { useIsPresent } from "framer-motion"export const Component = () => { const isPresent = useIsPresent() useEffect(() => { !isPresent && console.log("I've been removed!") }, [isPresent]) return <div />}
Generated using TypeDoc
Similar to
usePresence, exceptuseIsPresentsimply returns whether or not the component is present. There is nosafeToRemovefunction.