Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lessons/async-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ We need to handle asynchronous loading of data gracefully. We can't just show th
// replace Details.js
import React from "react";
import pf from "petfinder-client";
import Carousel from "./Carousel";

const petfinder = pf({
key: process.env.API_KEY,
Expand Down Expand Up @@ -168,6 +167,12 @@ export default Carousel;
Add the Carousel component to the Detail page.

```javascript
// add to imports
import Carousel from "./Carousel";

// add media when destructuring state
const { media, animal, breed, location, description } = this.state;

// first component inside div.details
<Carousel media={media} />
```
Expand Down