Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,552 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, react
Lĩnh vực
frontend, search

Hướng nghiên cứu

Bắt đầu bằng cách theo dõi ReactiveComponent.setQuery và hành vi ReactiveList.defaultQuery được mô tả trong issue, sử dụng CodeSandbox được liên kết để tái hiện trường hợp sắp xếp tùy chỉnh. Xác định cách các cập nhật truy vấn được xử lý và xác minh rằng hành vi sắp xếp được yêu cầu hoạt động với một component ReactiveList tùy chỉnh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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!

Ngôn ngữ chính
JavaScript
Star
4.9k
Fork
479
Merge trung bình
4 ngày 10 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của appbaseio/reactivesearch

Tất cả issue của appbaseio/reactivesearch

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.