Note: This is a follow up to the Data Table III question, you should complete that question first before attempting this question.
In Data Table III, we built a generalized data table that displays rows in a paginated format and allows for sorting rows by specific columns in both ascending and descending order. The DataTable component is not coupled to the data and can be used to render any type of data.
Extend the DataTable component to allow per-column filtering functionality.
To assist in your testing, another table has been rendered using houses data (src/data/houses.json). Feel free to comment out any code while working on the question. You should test your final solution with both datasets to ensure that the component remains generalized and flexible.
Hint: Have a look at this TanStack Table Column Filters example if you need inspiration on designing an API for adding filters.
The skeleton code uses the solution of Data Table III, but you are free to use your own solution as a starting point.
We'll build on top of Data Table III's solution.
In Data Table III, the DataTable implementation was generalized and no longer contains any code that is specific to users data. We need to preserve this generalization when extending the component with filtering functionality.
There are a few things that need to be done:
DataTable component to read the filter inputs state and use it when filtering data. Filtering has to be done before sorting and pagination occurs.