Join Joe Chellman for an in-depth discussion in this video Add a loader using conditional rendering, part of React for Web Designers (2018).
- [Instructor] When you're working with an API,…ideally, it's going to be super fast and no one will notice,…but in reality, connections can be slow,…so it's a good idea to plan for that.…In this video, we're going to look at conditional rendering,…setting up a loader animation that will display…while our page waits for its live data to come through.…So, let's switch over to the code…and take a look at what we have.…I'm going to use command shift O here in Visual Studio Code…to jump down to my status message list component.…Here we go.…The behavior that we have right now…is that the page will first show these stub statuses,…the hard-coded ones that are collapsed here,…and then, after the live data comes through,…it'll show those.…
Now, of course, we don't really want to show…what amounts to garbage data…before the real stuff comes through,…so first, we're going to get rid of the stubs,…and our initial state for the statuses…will become an empty array, like this,…so if we save that and switch back,…we can reload, so I mentioned network latency.…
- Identify notable features about how React works.
- Identify good early steps for any React project.
- Explain why the little PHP app that powers our API has a way to add delay.
- Outline what a lifecycle method is.
- Recall the React convention that must be followed when adding a status message.
- Explain the purpose of React.Fragment.
Skill Level Intermediate
1. Introducing React
2. First Project: Customizer
3. Second Project: Directory Browser
4. Third Project: Status Updater
Next steps: Lots more React2m 37s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.