diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9bd8981..5f95c85 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,6 @@ Congratulations! You're submitting your assignment. Please reflect on the assign Prompt | Response --- | --- -What is a Component in React? | -What are props in React? | -How did you use props in this project? | +What is a Component in React? | Reusable and independent bits of code. Similar to Javascript functions but returns HTML via a render function. | +What are props in React? | Properties used for passing data from one component to another. | +How did you use props in this project? | When moving the array of events (from timeline.json) up to the App.js level, giving it a const name of events, then passing this as a props into the const TimeLine as a parameter. | diff --git a/src/App.js b/src/App.js index 76d86d2..e8562f9 100644 --- a/src/App.js +++ b/src/App.js @@ -3,6 +3,11 @@ import logo from './logo.svg'; import './App.css'; import timelineData from './data/timeline.json'; import Timeline from './components/Timeline'; +import * as timeline from './data/timeline.json'; + +//array of events +const events = timeline.events + function App() { console.log(timelineData); @@ -11,9 +16,10 @@ function App() { return (