Created
May 24, 2020 16:33
-
-
Save Deepak13245/c4a466ab2da0b2bf81c420a2d183bd1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import PropTypes from "prop-types"; | |
import WeatherCard from './WeatherCard'; | |
import useWeather from "./weatherHook"; | |
function WithHook({ locationId }) { | |
const [data, reload] = useWeather(locationId); | |
return ( | |
<WeatherCard title="With Hooks" data={data} reload={reload} /> | |
) | |
} | |
WithHook.propTypes = { | |
locationId: PropTypes.number.isRequired | |
}; | |
export default WithHook; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment