From a499529dbf3eb5457e1428174553dc26e30cc7d3 Mon Sep 17 00:00:00 2001 From: Erik Ostrom Date: Wed, 29 May 2019 22:52:24 -0500 Subject: [PATCH] Bug fixes in async and events - Don't import Carousel until it exists. - Destructure `media` so we can render it. --- lessons/async-react.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lessons/async-react.md b/lessons/async-react.md index fdc00f2c..fe8ff75d 100644 --- a/lessons/async-react.md +++ b/lessons/async-react.md @@ -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, @@ -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 ```