Ravenous part4 business

Hi there!

Im having a hard time finishing the project.

Everything seems to work fine. Im getting an array of objects from the YelpAPI, and i can see in the devTool. But my business are not rendering with their props, and images. What could be wrong?

05

What is the purpose of this line?

let business = this.props;

What are the consequences?
What does the above cause to happen here:

<h2>{business.name}</h2>

To access the business name we need this:

<h2>{this.props.business.name}</h2>

Given that you assigned business the value this.props your code reads:

<h2>{this.props.name}</h2>

Seems like something is missing there. :wink:

Hi thanks for your input!

I guess the only reason for storing “this.props” in “let business” is to minimize redundant code in the component?
Never the less, i tried deleting the “let business” and use “this.props.business.name” throughout the code, but it didnt compile. Because in couldnt read the property of “this.props.business.name”.

I tried defining “business” as an const object, with curly braces. And that seemed to fix the problem.
22

The business are now rendering as expected :slight_smile: