|
| 1 | +# Advanced React - Async |
| 2 | + |
| 3 | +## Goal - understand (unidirectional) data flow |
| 4 | + |
| 5 | +## TODO |
| 6 | + |
| 7 | +* [recap] Component's life cycle hooks recap |
| 8 | +* [recap] State & Props |
| 9 | +* [recap] Children + [key](https://stackoverflow.com/questions/28329382/understanding-unique-keys-for-array-children-in-react-js#28329550) (re-render) |
| 10 | +* [recap] PropTypes - Runtime TypeSafety |
| 11 | +* [recap] Promises + Async |
| 12 | +* [concept] HOC - Higher order components |
| 13 | +* [concept] FAC - Function as children / [Render callback](http://reactpatterns.com/#render-callback) |
| 14 | +* [new] Effects |
| 15 | +* [new] Local (Components) state vs. Centralized (Atom) state |
| 16 | +* [new] Error handling / Loading (the state machine) |
| 17 | + |
| 18 | +## Problem - "Idea Journal" |
| 19 | + |
| 20 | +* make it work with server - CRUD |
| 21 | +* display loading state indicator |
| 22 | +* validate server payload via propTypes |
| 23 | + |
| 24 | +## Exercises |
| 25 | + |
| 26 | +1. display total number of notes in header // passing state down |
| 27 | +1. prevent saving an empty note (button must become disabled) |
| 28 | +1. add propTypes for `Header.js` and `Note.js` components |
| 29 | +1. replace the `default` with your github username in `./src/config/api.js` |
| 30 | +1. run `node upload-data.js` |
| 31 | + |
| 32 | +1. implement "load notes from server" (will be step-by-step walk through) 😈 |
| 33 | +1. fetch notes in `componentDidMount` of App.js, transform and save notes to state |
| 34 | +1. in App.js display `<Spinner />` instead of `<NoteList />` during server call |
| 35 | +1. in App.js display 0 notes if there are no notes on server |
| 36 | +1. in App.js display an `errorMessage` |
| 37 | +1. implement <EditNoteModal /> |
| 38 | +1. implement note deletion |
| 39 | +1. add propTypes everywhere |
| 40 | + |
| 41 | +## Learning resources |
| 42 | + |
| 43 | +* [React Forms](https://reactjs.org/docs/forms.html) |
| 44 | +* [You Might Need Redux](http://redux.js.org/) |
| 45 | +* [You Might Not Need Redux](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367) |
| 46 | +* [Michael Jackson - Never Write Another HoC](https://www.youtube.com/watch?v=BcVAq3YFiuc) |
| 47 | +* [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) |
0 commit comments