React-Admin Wrestling, a Little More Elasticsearch
React-admin is a wonderful framework, and is quite flexible; but if you need something that it doesn’t offer, it’s very difficult to dig through the docs to find out how to do it.
Today, I needed to add a conditional filter on a List page. The List
component takes a filters
prop, which is an Array of *Input
components. It does not accept a component to act as a wrapper or container around the *Input
s. The task was to have a “From Official Clipper?” filter (a boolean switch) for the Clips list; and if it’s unchecked, the List should then show a “Has Potential?” filter (another boolean switch), defaulting to false
. If “From Official Clipper?” is checked, then the “Has Potential?” filter should be disabled, because it’s assumed clips made official clippers have potential.