Siva Addanki
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
beta/src/content/learn/synchronizing-with-effects.md
|
@ -630,7 +630,7 @@ If your Effect subscribes to something, the cleanup function should unsubscribe: |
|
|
```js {6} |
|
|
```js {6} |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
function handleScroll(e) { |
|
|
function handleScroll(e) { |
|
|
console.log(e.clientX, e.clientY); |
|
|
console.log(window.scrollX, window.scrollY); |
|
|
} |
|
|
} |
|
|
window.addEventListener('scroll', handleScroll); |
|
|
window.addEventListener('scroll', handleScroll); |
|
|
return () => window.removeEventListener('scroll', handleScroll); |
|
|
return () => window.removeEventListener('scroll', handleScroll); |
|
|