DEV Community

Discussion on: Harnessing the Page Visibility API with React

Collapse
 
orelkan profile image
Orel Kanditan

Hi nice article, you're missing an empty array at the end of your useEffect.

Cool use of custom hooks

Collapse
 
darthknoppix profile image
Seth Corker

Good catch!
Right now it would fire the event every render instead of just on mount.

Collapse
 
orelkan profile image
Orel Kanditan

That's right