Skip to content

Commit df09c96

Browse files
authored
Link to react-intersection-observer
Thanks for the hook example! It was the original inspiration for upgrading [https://github.com/thebuilder/react-intersection-observer](https://github.com/thebuilder/react-intersection-observer) to support hooks. 🙌 The example is a really nice starting point, but also limited if you were to use it in production. `react-intersection-observer` supports all configuration options for IntersectionObserver, and the hook correctly handles creating new observers if props/ref changes. I think it would be a nice addition to provide a link for users looking to use an IntersectionObserver.
1 parent 8a7ac6b commit df09c96

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/pages/useOnScreen.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: useOnScreen
44
date: "2018-11-08"
55
gist: https://gist.github.com/gragland/d1175eb983772b077cb17ae0841c5329
66
sandbox: https://codesandbox.io/s/y7kr0vll4v
7+
links:
8+
- url: https://github.com/thebuilder/react-intersection-observer
9+
name: react-intersection-observer
10+
description: A more robust and configurable implemenation of this hook.
711
code:
812
"import { useState, useEffect, useRef } from 'react';\r\n\r\n// Usage\r\nfunction
913
App() {\r\n // Ref for the element that we want to detect whether on screen\r\n

0 commit comments

Comments
 (0)