Very basic weather applet for React with icons from react-icons-weather
Demo available here
npm install --save simple-react-weather
import React, { Component } from 'react'
import Weather from 'simple-react-weather'
class Example extends Component {
render () {
return (
//With city name provided
<Weather unit="C" city="CITY" appid="YOUR APPID FROM OWM" />
//Based on latitude and longitude
<Weather unit="C" lat="" lon="" appid="YOUR APPID FROM OWM" />
)
}
}
unit: String
C for Celcius, F for Fahrenheit
lat/lon: Number
Latitude and longitude, can be acquired from navigator.geolocation.getCurrentPosition()
city: String
appid: String
Your AppId from OWM
You can also use all other custom props like onClick, id etc.
GNU GPLv3 © iruszpel