Why don't we mention the concept of callBack props in the 'Lifting State Up' page?
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ả
There are times the source of the detailed or complete data is best isolated in a child component rather than trying to lift the state up and creating large parent component. The large parent component that has all the state, goes against the concepts of code isolation and separation of concerns,
Given this, why not add a note to https://reactjs.org/docs/lifting-state-up.html that talks about callback props?
There are 3 issues i'm aware of with callback props:
- that warning that the parent component is still rendering: solution: launch the event handler code asynchronously
2): In async functions, after await(), we should check whether the component is still mounted.
3): whenever a function is passed as a prop it must be frozen and then only added to the useEffect() dependency chain (better to add all dependencies for useEffect rather than ignore the warning)
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 với trang “Lifting State Up” tại reactjs.org/docs/lifting-state-up.html và xem xét callback props liên quan như thế nào đến hướng dẫn trên trang. Đánh giá ba mối quan ngại được liệt kê trong issue và xác định liệu có nên bổ sung một ghi chú chính xác vào trang hay không. Công việc được xem là hoàn tất khi tài liệu có một giải thích rõ ràng, được hỗ trợ về mặt kỹ thuật, hoặc phần bổ sung được đề xuất trong issue bị từ chối kèm lý do.
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100