GoogleChromeLabs / react-adaptive-hooks

Deliver experiences best suited to a user's device and network constraints
Apache License 2.0
5.1k stars 113 forks source link

[core] add more guarding around global.navigator #26

Closed theZieger closed 4 years ago

theZieger commented 4 years ago

This PR will add more guarding around the global.navigator.

When I was experimenting with the useNetworkStatus() hook inside Gatsby I was getting build errors due to the fact it was trying to access global.navigator which is not available when trying to server-side-render with Gatsby.

theZieger commented 4 years ago

so @addyosmani this can be closed in favor of #42 ?

addyosmani commented 4 years ago

Yes, let's close this with a view to https://github.com/GoogleChromeLabs/react-adaptive-hooks/pull/42 now being landed.