Reference:
I want to use react-reveal package but it doesn’t work for my project. My colleagues said cause it doesn’t have type, cause we make the typescript project. So the way to make it based on the author is:
Installation
In the command prompt run:
npm install react-reveal --save
Alternatively you may use yarn
:
yarn add react-reveal
Using
Import effects from React Reveal to your project. Lets try Zoom
effect first:
import Zoom from 'react-reveal/Zoom';
Place the following code somewhere in your render
method:
<Zoom><p>Markup that will be revealed on scroll</p></Zoom>
You should see zooming animation that reveals text inside the tag. You can change this text to any JSX you want. If you place this code further down the page you’ll see that it’d appear as you scroll down.
I have error at the import process as I mentioned before. Thanks to my colleague, I changed it to
const Zoom = require('react-reveal/Zoom');
And that’s it