Comments (5)
Yes. You're right. Generally, you don't have to use both of them in your use-case.
URLParams are updated by the library internally. For non-custom components it's value is determined by the value of the filter which is managed by the library. Since in a custom component(filter created using ReactiveComponent), we own the value of filter, we render the options and determine how user interacts with them. Hence, we call setQuery
passing the value of the filter.
If you want to change query dynamically using the custom component you created you should use setQuery
provided as props in the component which would sync with the URLParams.
However if you want to update the dependent component without user interacting with your component, like selecting a value, then you should use customQuery
. Here there is no way for the library to know the value of filter unless you explicitly set. One use case is mentioned in the documentation.
from reactivesearch.
Another issue that would prevent me from using setQuery is that it doesnt support highlight
from reactivesearch.
Hello @SavvyShah any comments regarding this issue?
Thanks
from reactivesearch.
Can you please explain the use case here? I'm not sure how you want to use the customQuery or what you are trying to achieve.
I've made a codesandbox here. Although I have defined a customQuery it still updates the URLParams.
from reactivesearch.
Thanks @SavvyShah yes I can see this works, but we still need to have CustomComponent and use setQuery. Is that expected? If custom query already has the query, why do I need the setQuery?
If I just have a ReactiveComponent like below shouldn't it still work? For me, it works but doesn't reflect in URLParams
`
<ReactiveComponent
URLParams=true
componentId={componentId}
filterLabel={label}
render={() => (
...
)}
customQuery={() => {
query
}}
`
from reactivesearch.
Related Issues (20)
- Vue - getCamelCase function breaks u-r-l-params HOT 2
- No results after upgrading to 3.43.7 HOT 7
- DynamicRangeSlider not rendering HOT 2
- React 18 Support HOT 3
- Not working with Vite Dev Mode HOT 5
- Unable to trigger "Show all" button action for <MultiList/> via keyboard
- Error if no credentials in ReactiveBase even if not using AppBase HOT 4
- Unable to load vue-slider ReferenceError: require is not defined (Vue.JS/Vite)
- The msearch request must be terminated by a newline [\n] HOT 1
- ReactiveComponent type HOT 2
- MultiList showLoadMore WITH nestedField
- Reactivelist re render when change page
- RangeInput Error for prop in Typescript HOT 1
- ReferenceError: AbortController is not defined in 3.45.0 because of recent changes HOT 5
- Can't resolve 'vue/server-renderer' HOT 16
- Unable to use multi-select and its giving error HOT 10
- [SearchBox mode=tag] Backspacing on ongoing search should not delete all previously selected keywords
- [ERROR] DateRange: Maximum update depth exceeded HOT 1
- Documentation for Analytics has wrong default value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reactivesearch.