In step 4 of the Thinking in React example, the ProductTable component filters and displays an array of products based on user input.
I am unsure why the code for filtering the products is in the ProductTable component and not the FilterableProductTable component. The same question was previously raised in issue #8035.
I think having FilterableProductTable be responsible for filtering the products would improve the example for two reasons:
- Allow
ProductTable to be used outside of FilterableProductTable
- Better separate the concerns of filtering the products from displaying the products
I updated the example and I'm happy to submit a PR if this is something that should be changed.