The definition of one-way data flow is confusing
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ả
I was researching about data binding concept.
then found followings.
one-way data bindingtwo-way data binding
What I understand about data binding is about how Data and View are affecting each other.
one-way data bindingis using event-listener function to achieveView to DataData to Viewtogether.
(i.e, displaying input value in<p>tag.)two way data bindingis using the binding syntax (not using event-listener) and it can achieveView to DataData to View
(i.e, displaying input value in<p>tag.)
but when I read the official React document on react.dev.
It talks about one way data flow which is a bit confusing expression then it says this concept is about top to bottom parent to child. (which is completely different from the definition of one-way data binding).
// from the link below.
Remember: React uses one-way data flow, passing data down the component hierarchy from parent to child component.
https://react.dev/learn/thinking-in-react#step-4-identify-where-your-state-should-live
then when it talks about two way data binding the document brings displaying the input value on screen.
Which is not related to topic about Top to Bottom.
// from the link below.
React makes this data flow explicit, but it requires a little more typing than two-way data binding. If you try to type or check the box in the example above, you’ll see that React ignores your input.
https://react.dev/learn/thinking-in-react#step-5-add-inverse-data-flow
I feel like this concept needs to be updated to clarify the concept of data binding.
or if the document content is correct, Can someone explain what I am missing or confused about this document?
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 các phần được liên kết của Thinking in React, đặc biệt là “Identify Where Your State Should Live” và “Add Inverse Data Flow”, rồi so sánh cách chúng sử dụng “one-way data flow” và “two-way data binding”. Công việc được xem là hoàn tất khi tài liệu phân biệt rõ ràng các khái niệm này hoặc giải thích thuật ngữ đã gây ra sự nhầm lẫ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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100