We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a80f36c commit 6a6fb51Copy full SHA for 6a6fb51
Readme.md
@@ -256,18 +256,17 @@ As soon as at least 1px of the child element is visible in the parent document v
256
```jsx
257
import React from 'react'
258
import ReactDOM from 'react-dom'
259
-import useIsInViewport from 'use-is-in-viewport
+import useIsInViewport from 'use-is-in-viewport'
260
261
export default function SimpleElement() {
262
const [isInViewport, childElToWatch] = useIsInViewport()
263
264
return (
265
- <div ref={childElToWatch}>
266
- <p>{isInViewport ? 'In viewport' : 'Out of viewport'}</p>
267
- </div>
+ <div ref={childElToWatch}>
+ <p>{isInViewport ? 'In viewport' : 'Out of viewport'}</p>
+ </div>
268
)
269
}
270
-
271
```
272
273
More examples coming soon...
0 commit comments