In this exercise, you'll practice passing props to a child component from a parent component (see demo-1 for a similar example). In your main.jsx file:
-
Fill in your
EmployeeRowrender function to return a table row (<tr>) for an employee. You should create a separate table element (<td>) for the employeename,title, andsalary(each of these will be received via props). -
Fill in the
EmployeeTablerender function (already started) to iterate through the EmployeeTable data that is received via props, and create anEmployeeRowcomponent for each element in your array. Make sure to pass in the necesary data in the props! -
Use
ReactDOMto render anEmployeeTableelement, making sure to pass in the appropriate props.