Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Custom sorting in Reactivesearch: possibly expose `sort` key on `ReactiveComponent`'s `setQuery`

Aperta
#1,552 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, react
Ambito
frontend, search

Direzione di ricerca

Inizia tracciando ReactiveComponent.setQuery e il comportamento di ReactiveList.defaultQuery descritto nell'issue, utilizzando il CodeSandbox collegato per riprodurre il caso di ordinamento personalizzato. Determina come vengono gestiti gli aggiornamenti della query e verifica che il comportamento di ordinamento richiesto funzioni per un componente ReactiveList personalizzato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Affected Projects
All

Is your feature request related to a problem? Please describe.

Main problem to solve: I would like to create a custom sorting component for the ReactiveList. There have been several issues that have been opened about this already such as: https://github.com/appbaseio/reactivesearch/issues/258 where @metagrover wrote about updating the defaultQuery of the result component.

I tried this but it seems like the inner defaultQuery does not update upon setting a new state.

Describe the solution you'd like
I think the most intuitive way to do this is to expose the sort key on ReactiveComponent's setQuery. Right now, only changes to query are made so it isn't as flexible as it can be.

Describe alternatives you've considered
An alternative solution is to allow the defaultQuery to be updated when its function/props change.

I might have been doing this wrong so I've provided a codesandbox with both @metagrover 's proposed solution updating the defaultQuery of ReactiveList as well as showing how a potential setQuery with the sort key may look like.

https://codesandbox.io/s/tender-ritchie-15b32?file=/src/index.js

Please let me know if there's any other solution that might be better than these. Thanks!

Lingua principale
JavaScript
Stelle
4.9k
Fork
479
Merge medio
4g 10h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di appbaseio/reactivesearch

Tutte le issue di appbaseio/reactivesearch

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.