1.0.3 • Published 2 years ago

@clurts/use-location v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

use-location

Installation

To install using npm:

npm i @clurts/use-location

To install using yarn:

yarn add @clurts/use-location

Usage

Import the useLocation hook:

import useLocation from "@clurts/use-location"

In your component use as follows:

const [isLocating, position, error] = useLocation()

Api

isLocating: boolean - indicates wehter or not your postion is being retrieved currently.

position: object - containing geolocation information

Properties on the position object: | Property | Description | | --- | ----------- | | lat | Returns the current position latitude | | long | Returns the current position longitude |

error: string - error messages if access to location data is blocked or geolocation is not supported by the browser.

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago