I'm fairly new to React and I would really appreciate some help on this, as its been driving me nuts.
I am trying to figure out how I can pass props into searchkit's listComponent
from the <ViewSwitcherHits/>
component.
Parent Component:
<ViewSwitcherHits
hitComponents={[
{key:"query", title:"Query", listComponent:QueryDetailView, defaultOption:true}
]}
/>
So the QueryDetailView
is a custom Component I created that requires props in order to show a detail view of a selected query. The user selects a query block from a dropdown in another Component, and that selected filter would then display in the QueryDetailView
Component. There may be a better way to pass that selected query object from a child to the parent back down to the QueryDetailView
child. I come from Angular so I know a service would be perfect for this, but not sure how to implement in React. Or if Searchkit even allows passing in props into an ItemComponent
.
I hope this is enough information. If not, please let me know and I will add more code. Thanks!