Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,552 3 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript, react
Área
frontend, search

Línea de trabajo

Comienza rastreando ReactiveComponent.setQuery y el comportamiento de ReactiveList.defaultQuery descrito en el issue, utilizando el CodeSandbox enlazado para reproducir el caso de ordenación personalizada. Determina cómo se gestionan las actualizaciones de la consulta y verifica que el comportamiento de ordenación solicitado funciona para un componente ReactiveList personalizado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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!

Lenguaje dominante
JavaScript
Estrellas
4.9k
Forks
479
Merge medio
4 d 10 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de appbaseio/reactivesearch

Todos los issues de appbaseio/reactivesearch

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.