loading property returned by useFetchPosts isn't entirely accurate
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 42/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ệ
- next.js, react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách tìm useFetchPosts và so sánh cách tính trạng thái loading của nó với giá trị isLoading do useFetch trả về. Sau đó, kiểm tra component RelatedPosts trong wp-nextjs-app để hiểu cách nó xử lý loading, dữ liệu và NotFoundError. Hoàn thành khi trạng thái loading kết thúc chính xác trong trường hợp không tìm thấy dữ liệu mà không làm hỏng hành vi hiện tại của component.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your enhancement related to a problem? Please describe.
When there is no data to return from useFetchPosts and a NotFoundError is returned instead, the loading property is still set to true.
For components that are relying on this property to display some sort of loading state, this can mean that they display that loading state indefinitely. An example of this can be seen in the RelatedPosts component of wp-nextjs-app.
https://share.zight.com/v1uq5KWZ
useFetch returns an accurate isLoading property to useFetchPosts, however, useFetchPosts does not use this and instead generates its own loading property. Components like RelatedPosts will then assume that if useFetchPosts isn't loading, it must have data. However, there is also the possibility that it is done loading and just has not found any data.
I'm not sure if we can change this behavior without breaking things since there may be components that are built with this existing behavior in mind, but it would be nice to be able to know if something is done loading, even if it doesn't return results.
Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- TypeScript
- Star
- 204
- Fork
- 26
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 10up/headstartwp
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
10up/headstartwp#950 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
10up/headstartwp#948 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
10up/headstartwp#902 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
10up/headstartwp#900 ·
-
Breaking Changes Roadmap / 2.0Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
10up/headstartwp#857 ·
Tất cả issue của 10up/headstartwp
Issue tương tự
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
db-ux-design-system/core-web#8856 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerCó thể đã có người làm @wittdennis đã nhận hôm nay. Đang mởpriority: p3 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
googleapis/release-please#2971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🛠️ dette technique
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
betagouv/mon-entreprise#4752 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày