Recently, I started learning React and was tackling a simple project. Below is the code snippet that I have been working on. While working on it, I came across a situation where I needed to print the value of listItem={people} which is passed as props in my List component. So, to get a better understanding of what exactly is stored in listItem here, I attempted {console.log(listItem)} but unfortunately, it returned an 'undefined' error.
*react*
function App() {
const [people, setPeople] = useState(data);
return (
<div className="container">
<h3>{people.length} birthdays today</h3>
<List listItem={people} />
<button onClick={() => setPeople([])}>Clear All</button>
</div>
);
}
export default App;