Smarter Filtering in React – How We Built a Reusable Component for Complex Data
summary
Harness replaces a brittle, page-specific filter UI with a reusable inline filters system that scales across listing pages, handles thousands of pipeline executions with 16+ fields, and reduces developer work. Iteration moves from naive shared state to an anti-pattern using React.cloneElement to a clear Context API + inversion of control. Core pieces: a filters map holding value/query/state and bidirectional parsers for URL serialization. Result: instant filtering, type safety, better performance, decoupling, easy testing, and positive internal rollout feedback.
AI-written summary · about
chapters (14)
- 0:00Introduction and motivation
- 1:02Why filtering matters in apps
- 3:12Defining usability and technical goals
- 5:00First iteration pitfalls
- 6:06React.cloneElement drawbacks
- 6:27Context API with inversion of control
- 9:19How filters work in practice
- 11:26Parsers for URL synchronization
- 13:13Filters map and state management
- 16:01Data flow from user to URL
- 17:49Live demo of filter implementation
- 24:15Advanced features and flexibility
- 25:40Evolution of the design
- 26:21Key takeaways and summary
