Created
November 18, 2019 19:27
-
-
Save yonibot/f6a763c0026eee2eeaf9fa3a4598b583 to your computer and use it in GitHub Desktop.
Consuming the final hook
This file contains hidden or 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
| // App.js | |
| ... | |
| import { useWeatherService } from './useWeatherService'; | |
| const [ currentUnit, setUnit ] = useState(TEMPERATURE_UNITS.metric); | |
| function App({coords}) { | |
| const weather = useWeatherService(coords, currentUnit); // <- all that's left of the API logic :) | |
| ... | |
| return ( | |
| <div className="App"> | |
| ... | |
| </div> | |
| ); | |
| } | |
| export default geolocated()(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment