Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space - Becca #28

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Space - Becca #28

wants to merge 6 commits into from

Conversation

RebeccaRoach
Copy link

Assignment Submission: Timeline

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Prompt Response
What is a Component in React? A React Component is a piece of reusable code that is used to render related similar pieces of content in a same visual style. React Components can be functions or classes, but the concept is the same: to make UI rendering more easy and efficient by grouping related Components together or, if appropriate, to nest Components inside of other Components. As each Component represents a portion of the UI which can stand on its own, it is independent of other Components and can be updated separately. This modularity is part of what makes React such a powerful tool and framework for web development.
What are props in React? React props are one of the two major ways to pass information from one component to another. Props are passed as parameters to components, which can then use/ display but not modify these props. For now, we've seen that parent Components pass props to children Components, but that children Components cannot access a parent's props.
How did you use props in this project? In this project, I used props in my TimelineEvent Components to display 3 things: the name of the author of our social media posts, the status text of their post, and the timestamp of their post, which was actually a Component in and of itself. Props can be strings, integers, arrays, and even other Components. Timeline utilizes the props it receives by mapping over the events array of objects from timeline.json ; this mapping creates an array of individual TimelineEvent Components as a result. The App component is where I passed the events as props to the Timeline Component: events={timelineData.events}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant