Create Application Structure for Birthday Reminder App
In this step, we will create the basic structure to the application such as the output display area. This will make it easy to view the elements we need for the application.
- For the birthday reminder, we need to only display the people’s details.
- Create a
List.jsxfile to format the data.
// List.jsx
import React from 'react'
// accept props here
const List = (props) => {
const { people } = props
// Map over prop "people" and code the right structure
return people.map((person) => {
const { id, name, age, image } = person
return (
<article key={id}>
<img src={image} alt={name} />
<div>
<h4>{name}</h4>
<p>{age} years</p>
</div>
</article>
)
})
}
export default List- Now that we created a format for the data using a component. Let’s create the application structure.
- Modify the code in
App.js
import React from 'react'
import data from './data/data'
import List from './List'
function App() {
}
return (
<main>
<h1>Birthday Reminder</h1>
<section className="container">
<h3> birthdays today</h3>
<List people={people} />
<button >Clear All</button>
</section>
<a href="https://www.guvi.in/" className="copywright">
Made by Guvi💚
</a>
</main>
)
}
export default App

