Plan and done for May-27-2018
What will I learn today?
FreeCodeCamp React projects: Camper Leaderboard.
Done
Challenges
- I want to use async/await for fetching data but what about catching errors?
- When and where to fetch initial data to React app?
Solutions
- Here is the receipt to do it with style:
function to(promise) { return promise.then(data => { return [null, data]; }) .catch(err => [err]); }
- The right place is
componentDidMount. An explanation - Initial data via AJAX.