Skip to content

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