File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 1- # React Scroll Trigger
1+ # react-scroll-trigger
22
33React component that monitors ` scroll ` events to trigger callbacks when it enters,
44exits and progresses through the viewport. All callback include the ` progress ` and
@@ -8,25 +8,20 @@ those values.
88## Install
99
1010Via [ npm] ( https://npmjs.com/package/react-scroll-trigger )
11- ```
11+
12+ ``` sh
1213npm install react-scroll-trigger
1314```
1415
1516Via [ Yarn] ( http://yarn.fyi/react-scroll-trigger )
16- ```
17+
18+ ``` sh
1719yarn add react-scroll-trigger
1820```
1921
20- ### Requirements
21-
22- * [ react] ( https://npmjs.com/package/react )
23- * [ react-dom] ( https://npmjs.com/package/react-dom )
24- * [ prop-types] ( https://npmjs.com/package/prop-types )
25- * [ lodash] ( https://npmjs.com/package/lodash )
26-
2722## How to use
2823
29- ```
24+ ``` js
3025import ScrollTrigger from ' react-scroll-trigger' ;
3126
3227...
@@ -59,14 +54,14 @@ import ScrollTrigger from 'react-scroll-trigger';
5954The ` ScrollTrigger ` is intended to be used as a composable element, allowing you
6055to either use it standalone within a page (ie. no children).
6156
62- ```
57+ ``` js
6358 < ScrollTrigger onEnter= {this .onEnterViewport } onExit= {this .onExitViewport } / >
6459```
6560
6661Or, pass in children to receive events and ` progress ` based on the dimensions of
6762those elements within the DOM.
6863
69- ```
64+ ``` js
7065 < ScrollTrigger onEnter= {this .onEnterViewport } onExit= {this .onExitViewport }>
7166 < List>
7267 [... list items... ]
You can’t perform that action at this time.
0 commit comments