UNPKG

@rooks/use-geolocation

Version:

A hook to provide the geolocation info on client side.

21 lines (19 loc) 467 B
interface IGetGeoLocation { lat?: number; lng?: number; isError: boolean; message: string; } interface IOptions { enableHighAccuracy?: boolean; timeout?: number; maximumAge?: number; when?: boolean; } /** * useGeolocation * Gets the geolocation data as a hook * @param geoLocationOptions Geolocation options */ declare function useGeolocation(geoLocationOptions?: IOptions): IGetGeoLocation | null; export default useGeolocation;