jesseditson / weather-view

A weather widget written in React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weather-view

A weather widget written in React

In general, this is a demonstration repo for publishing shared React components, and all the wild build tools available.

Uses https://openweathermap.org/current to fetch some data and display it. Requires an API key for this service, but it's free for low usage.

Looks like this: image of weather component

To obtain an API key, go to https://openweathermap.org and sign in, then click on API Keys:

image of openweathermap website pointing to api keys page

Then generate a new key and copy it to your react component

image of clicking the generate api key button

Usage:

npm install --save weather-view

Then, in a React 16 project:

import Weather from 'weather-view'

export const MyComponent = () => {
    return (
        <div>
            <Weather
                apiKey={/* Open Weather Map API Key */}
                location={/* a location to pass to Open Weather Map API */}
            />
        </div>
    )
}

About

A weather widget written in React

License:MIT License


Languages

Language:TypeScript 92.5%Language:JavaScript 7.5%