Conflicting description on getSnapshotBeforeUpdate section on the React.Component 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ả
Page: https://reactjs.org/docs/react-component.html
Section: getSnapshotBeforeUpdate
The description after the code block reads
In the above examples, it is important to read the scrollHeight property in getSnapshotBeforeUpdate because there may be delays between “render” phase lifecycles (like render) and “commit” phase lifecycles (like getSnapshotBeforeUpdate and componentDidUpdate).
It is indicating that we should be reading the scrollHeight property in getSnapshotBeforeUpdate due to the delays between the "render" phase lifecycles and "commit" phases lifecycles. But getSnapshotBeforeUpdate is indicated as one of the "commit" phases lifecycle. Is that correct?
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
Đọc phần getSnapshotBeforeUpdate trên trang React.Component tại https://reactjs.org/docs/react-component.html, bao gồm cả khối mã và phần giải thích được đặt trong dấu ngoặc kép bên dưới. Kiểm tra xem mô tả có phân biệt đúng các lifecycle của render phase và commit phase hay không, sau đó cập nhật cách diễn đạt mâu thuẫn để thời điểm của lifecycle trở nên rõ ràng, không thể hiểu nhầm.
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ó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- 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