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
EmployeeRow
render 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
EmployeeTable
render function (already started) to iterate through the EmployeeTable data that is received via props, and create anEmployeeRow
component for each element in your array. Make sure to pass in the necesary data in the props! -
Use
ReactDOM
to render anEmployeeTable
element, making sure to pass in the appropriate props.