New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

use-season

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-season

React hooks to get the season based on the geo location browser api.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

use-season

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

Installation :

  npm install use-season

Usage :

import React from 'react';
import useSeason from 'use-season';

function App() {
  const { error, loading, season, fetchSeason } = useSeason();
  if (loading) return <p>loading...</p>;
  return (
    <>
      {error && !season && error}
      {season && !error && season}
      <button onClick={fetchSeason}> Click me </button>
    </>
  );
}

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 !

Keywords

react

FAQs

Package last updated on 27 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts