Ravenous Part 2: Passing Information

Congratulations on completing your project!

Compare your project to our solution code and share your project below! Your solution might not look exactly like ours, and that’s okay! The most important thing right now is to get your code working as it should (you can always refactor more later). There are multiple ways to complete these projects and you should exercise your creative abilities in doing so.

This is a safe space for you to ask questions about any sample solution code and share your work with others! Simply reply to this thread to get the conversation started. Feedback is a vital component in getting better with coding and all ability levels are welcome here, so don’t be shy!

About community guidelines: This is a supportive and kind community of people learning and developing their skills. All comments here are expected to keep to our community guidelines

How do I share my own solutions?

  • If you completed the project off-platform, you can upload your project to your own GitHub and share the public link on the relevant project topic.
  • If you completed the project in the Codecademy learning environment, click on “Tools” and use the create a gist button, and then share that link here.

Do I really need to get set up on GitHub?
Yes! Both of these sharing methods require you to get set up on GitHub, and trust us, it’s worth your time. Here’s why:

  1. Once you have your project in GitHub, you’ll be able to share proof of your work with potential employers, and link out to it on your CV.
  2. It’s a great opportunity to get your feet wet using a development tool that tech workers use on the job, every day.

Not sure how to get started? We’ve got you covered - read this article for the easiest way to get set up on GitHub .

Best practices for asking questions about the sample solution

  • Be specific! Reference exact line numbers and syntax so others are able to identify the area of the code you have questions about.

My Version so far titled TasteMate

In the sample solution, I do not understand how the Business.js component ties in with the rest of the code. I understand that it has the code for the styling of the instance of the business object when rendered, but do not understand how it is connected to the App component for example. Any explanation would be very helpful as I am trying to further understand props and how they pass info from component to component

This is the Business.js component

This is the App.js component

In your App.js file you are passing the array of object to business list. So what business list is receiving us the const Businesses.
From there in BusinessList.js you currently have an array of Business objects that you need to map through in order to be able to have access to all the elements within the object. Once you map you have created individual objects from the array.
Lastly you have the Business.js which is receiving an individual object from the array. Now each business has elements that you can access.
So to put it all together App.js → passes Array of Objects to BusinessList.js → map through Array → passes individual Object to Business.js → access elements of Object to display in Business.js

Thank you for the detailed explanation, It makes better sense now.
The way I understand it is that the passing of components as props is done in a top-down movement from parent to child. I will keep working more on this project to understand more. Thanks again.

this is my part of solution, I tried to mimic and Yes! it’s almost same…