DEV Community

loading...

Discussion on: Adding a service worker into your Next.js application

Collapse
josedonato profile image
José Donato Author

if you see the source code i'm calling the window load inside useEffect but maybe it is redundant to have both the listener and useEffect :)

Collapse
riper profile image
Magnus Bondesson

Yes the window load listener is redundant and can be removed. I just tried this and everything loads correctly.

Thanks for this great hands-on tutorial!

Thread Thread
josedonato profile image
José Donato Author

Glad you liked it. Thanks for the input!