From the course: React: State Management (2019)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Data fetching only using React - React.js Tutorial
From the course: React: State Management (2019)
Data fetching only using React
- [Instructor] One of the most common ways to introduce complexity into your app is by introducing an API call. Where should that API call live? What should we do with that data once we have it? It's easy to jump to a more complex solution that involves Redux, setting up Boilerplate, et cetera. In lots of causes though, using the built-in React methods suffice just fine. Let's take a look at our book collection example. Suppose we don't want to use a hard-coded set of books, and maybe we want to re-read Jane Austen books. In order to that, we're going to be using the Google Books API. Let's take a look specifically at the performing a search section. We can use the Google Books API to dynamically load the books for a given author using this inauthor query string. What we want is we want for these books to dynamically appear for the users when they first load the page. But which React life cycle should we look at? There are a couple of different options. The first one is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Avoid prematurely adding state management packages3m 2s
-
(Locked)
The power of setState()3m 21s
-
(Locked)
Data fetching only using React4m 16s
-
(Locked)
Avoiding the pitfall of prop drilling4m 2s
-
(Locked)
Defining Context2m 2s
-
(Locked)
Using the Context API4m 30s
-
(Locked)
Implementing Hooks3m 23s
-
(Locked)
React Hooks: Refactoring2m 32s
-
(Locked)
-
-
-
-