Skip to content

Commit 36da404

Browse files
committed
Add polyfill section to readme
1 parent f06f2d1 commit 36da404

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ or NPM:
3333
npm install react-intersection-observer --save
3434
```
3535

36+
### Polyfill for intersection-observer
37+
The component requires the [intersection-observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API) to be available on the global namespace. At the moment it is included in Chrome, Firefox, Opera and Edge. Make sure to include the polyfill to support other browsers like IE and Webkit.
38+
39+
You can import the [polyfill](https://github.com/jeremenichelli/intersection-observer-polyfill) directly or use a service like [polyfill.io](https://polyfill.io/v2/docs/).
40+
41+
```sh
42+
yarn add intersection-observer-polyfill
43+
```
44+
45+
Then import it in your app
46+
47+
```js
48+
import 'intersection-observer-polyfill'
49+
```
50+
3651
## Props
3752
The **`<Observer />`** accepts the following props:
3853

0 commit comments

Comments
 (0)