Skip to content

Instantly share code, notes, and snippets.

@Deepak13245
Created May 24, 2020 16:33
Show Gist options
  • Save Deepak13245/c4a466ab2da0b2bf81c420a2d183bd1f to your computer and use it in GitHub Desktop.
Save Deepak13245/c4a466ab2da0b2bf81c420a2d183bd1f to your computer and use it in GitHub Desktop.
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