reactjs / reactjs/react.dev

The definition of one-way data flow is confusing

オープン
#6,228 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

I was researching about data binding concept.
then found followings.

  1. one-way data binding
  2. two-way data binding

What I understand about data binding is about how Data and View are affecting each other.

  1. one-way data binding is using event-listener function to achieve View to Data Data to View together.
    (i.e, displaying input value in <p> tag.)
  2. two way data binding is using the binding syntax (not using event-listener) and it can achieve View to Data Data 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?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされている Thinking in React のセクション、特に「Identify Where Your State Should Live」と「Add Inverse Data Flow」から始め、「one-way data flow」と「two-way data binding」がどのように使われているかを比較してください。ドキュメントがこれらの概念を明確に区別するか、混乱の原因となった用語を説明していれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
documentation
issue の種類
ドキュメント
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。