UNPKG

@oieduardorabelo/use-navigator-online

Version:

React Hooks to detect when your browser is online/offline.

13 lines (12 loc) 508 B
import React from 'react'; interface IState { whenOnline?: React.ReactNode; whenOffline?: React.ReactNode; startOnline?: boolean; } declare function useNavigatorOnline(state?: IState): { status: number | boolean | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactFragment | null | undefined; isOnline: boolean; isOffline: boolean; }; export { useNavigatorOnline };