Closed bolekro closed 6 years ago
We internally expose setQuery
as a prop to all the children passed to the ReactiveComponent
. You can check this snack to see how to use the setQuery
method with the ReactiveComponent.
That is what I figured from the ReactiveComponents.js src file. Do you have any idea why my child component is not seeing it (getting undefined error for props.setQuery)?
My code snippet:
<ReactiveComponent
componentId="id"
defaultQuery={() => ({
query: {
match_all: {},
}
})}
>
<ChildComponent />
</ReactiveComponent>
I'm not too sure. Can you create a snack snippet replicating your issue here?
PS: Make sure that your ReactiveComponent
is wrapped inside a ReactiveBase
component.
Thank you for your help, turned out my callback function did not have proper binding. After correction the ReactiveComponent works great.
Issue Type: Question
Description: I just had a clarifying question on how the setQuery prop in ReactiveComponent's child is supposed work. I tried to build something similar to https://opensource.appbase.io/reactive-manual/native/advanced/reactivecomponent.html, but I am getting props.setQuery undefinied errror.
My question therefore is how the setQuery is supposed to work in the ReactoveComponent's child, as we never pass to it - in the example to the ColorPickerWrapper? The example specifies we only have to:
If anyone had success setting up custom ReactiveComponents and understands how it works please clarify it for me.
BTW, thanks for this project.
Screenshots: N/A
Minimal reproduction of the problem with instructions: N/A
Reactivesearch version: native 0.6.2
Browser: N/A
Anything else: N/A