React hook for using scroll to reveal components
npm install --save use-scroll-to-reveal
import React, { useRef } from 'react'
import { useScrollToReveal } from 'use-scroll-to-reveal'
const Example = () => {
const ref = useRef()
const revealed = useScrollToReveal(ref)
return (
<MyCompnentThatAnimatesWhenRevealedIsTrue
ref={ref} revealed={revealed}/>
)
}
MIT © Hermanya