In this exercise, you'll practice changing the state of an application. We'll begin with a simple table, and then make that table filter-able by doing the following in the main.jsx
file:
- Add a function
filter
to yourEmployeeTable
component in which you get the value of the event (event.target.value
), and then set the state of yoursearchString
to that value - In your
render
function, usethis.state.searchString
to filter down youremployees
array. - Assign an
onChange
event to your<input>
element so that it executes yourfilter
function (i.e.,this.filter
)