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

Ampers: Nora Peters #22

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

Ampers: Nora Peters #22

wants to merge 8 commits into from

Conversation

npeters5
Copy link

React Timeline

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Explain what purpose a component serves in React? A component is an individual javascript class that represents pieces of the user interface in the form of HTML and CSS. Components also manage their own internal state and can be composed within one another to create a web app. Components also receive props (aka properties) from external sources, and they can be anything from a string or number to an object.
How does adding dynamic content to a web page in React compare to jQuery? With React, all of the HTML content is created in JS files using JSX, whereas with jQuery you need to write the HTML and use event listeners and then usually 'append' new html elements with whatever attributes you want, including unique identifiers such as an id number. React makes it much easier to apply these unique attributes through the use of props. I think.
How did you use props in this project? I'm going to write a lot to try and understand this... Props are used to pass data from the parent components to the child components. In this project, the JSON data originally is received by App.js, and when the component is being created, the data is passed as a prop called 'timeline' to the Timeline.js file , where it is parsed. Then when the components are being created (using .map), that parsed data is assigned as props called person, status, and timestamp. Then the TimelineEvent.js is able to 'read' those props as it builds each individual TimelineEvent component inside article/div/p tags and pass them up to Timeline.js. Lastly, inside TimelineEvent component, a 'time' prop is assigned and the Timestamp component uses this prop to format and return the time data inside of a .
Do you have any recommendations on how we could improve this project for the next cohort? Yes, please discuss why there are so many components and address why the JSON should be parsed in a certain component. This was very unclear to me, given the in-class examples.

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