Skip to content

Commit 435c217

Browse files
committed
Update README and add formatting to code blocks
1 parent 85acbdc commit 435c217

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# React Scroll Trigger
1+
# react-scroll-trigger
22

33
React component that monitors `scroll` events to trigger callbacks when it enters,
44
exits and progresses through the viewport. All callback include the `progress` and
@@ -8,25 +8,20 @@ those values.
88
## Install
99

1010
Via [npm](https://npmjs.com/package/react-scroll-trigger)
11-
```
11+
12+
```sh
1213
npm install react-scroll-trigger
1314
```
1415

1516
Via [Yarn](http://yarn.fyi/react-scroll-trigger)
16-
```
17+
18+
```sh
1719
yarn 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
3025
import ScrollTrigger from 'react-scroll-trigger';
3126

3227
...
@@ -59,14 +54,14 @@ import ScrollTrigger from 'react-scroll-trigger';
5954
The `ScrollTrigger` is intended to be used as a composable element, allowing you
6055
to either use it standalone within a page (ie. no children).
6156

62-
```
57+
```js
6358
<ScrollTrigger onEnter={this.onEnterViewport} onExit={this.onExitViewport} />
6459
```
6560

6661
Or, pass in children to receive events and `progress` based on the dimensions of
6762
those elements within the DOM.
6863

69-
```
64+
```js
7065
<ScrollTrigger onEnter={this.onEnterViewport} onExit={this.onExitViewport}>
7166
<List>
7267
[...list items...]

0 commit comments

Comments
 (0)