An open API service indexing awesome lists of open source software.

https://github.com/adarshaacharya/use-season


https://github.com/adarshaacharya/use-season

react

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

# use-season

0 dependencies react hooks to get the season based on the browser geo location api.

## Installation :
```bash
npm install use-season
```

## Usage :
```jsx
import React from 'react';
import useSeason from 'use-season';

function App() {
const { error, loading, season, fetchSeason } = useSeason();
if (loading) return

loading...

;
return (
<>
{error && !season && error}
{season && !error && season}
Click me
>
);
}

export default App;

```

### Note :
This package is based on the browser Geolocation API so, browser will ask you to use your location in that case you must click Allow else it won't work.

### Demo
[Check it out !](https://codesandbox.io/s/use-season-example-1zp6z)