[Suggestion]: Add a note about the `use` API as an alternative to `useEffect`
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 11.8k
- Fork
- 7.9k
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 11
Mô tả
Summary
The section on the useEffect page about good alternative to fetching data is a great resource, but does not mention the use API at all. I recommend adding some text to clarify the existence of this option and any pros/cons.
Page
https://react.dev/reference/react/useEffect#what-are-good-alternatives-to-data-fetching-in-effects
Details
It is unclear from the documentation what the relationship between useEffect and use is. The useEffect page does not mention the use API at all, and neither does the use page. The useEffect page contains a section called “Fetching data with Effects”, and the use page contains a section called Streaming data from the server to the client. So, it sounds like both can be used for fetching data, but there is no acknowledgement of this or relevant guidance.
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.
Hướng nghiên cứu
Bắt đầu bằng cách đọc phần “What are good alternatives to data fetching in Effects?” trên trang useEffect và phần “Streaming data from the server to the client” trên trang use. Làm rõ mối quan hệ giữa useEffect và use, bao gồm các đánh đổi liên quan, đồng thời cập nhật tài liệu để người đọc có thể xác định khi nào nên áp dụng từng cách tiếp cận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, react
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100