Skip to content

Commit b44d3bc

Browse files
committed
update README for importing ParallaxScroller
1 parent 9dd5aef commit b44d3bc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ Provides a React component and single global passive scroll listener to add **ve
88

99
[Parallax Testing](https://jscottsmith.github.io/react-scroll-parallax/examples/parallax-test/)
1010

11-
## Usage
11+
## Install
1212

1313
Install
1414

1515
```
1616
npm i react-scroll-parallax
1717
```
1818

19-
Import `ParallaxScrollListener` on the client side. This will self invoke and create the **global** `ParallaxScrollListener` which will handle updating all parallax elements on scroll.
19+
## Usage
20+
21+
Import `ParallaxScroller` on the client side and call `ParallaxScroller.init()` to create the global singleton `ParallaxScrollListener` which will handle updating all parallax elements on scroll.
2022

2123
```
22-
import 'react-scroll-parallax/libs/ParallaxScrollListener';
24+
import { ParallaxScroller } from 'react-scroll-parallax';
25+
26+
ParallaxScroller.init();
2327
```
2428

2529
Import the `Parallax` component...

0 commit comments

Comments
 (0)