Skip to content

Commit

Permalink
merging all conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
react-translations-bot committed Oct 23, 2023
2 parents 42a3f30 + a0cacd7 commit 22f8d0f
Show file tree
Hide file tree
Showing 22 changed files with 700 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/docs/diagrams/render_tree.dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/docs/diagrams/render_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/content/community/meetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ title: React ミーティング
* [Montreal, QC - React Native](https://www.meetup.com/fr-FR/React-Native-MTL/)
* [Vancouver, BC](https://www.meetup.com/ReactJS-Vancouver-Meetup/)
* [Ottawa, ON](https://www.meetup.com/Ottawa-ReactJS-Meetup/)
* [Saskatoon, SK](https://www.meetup.com/saskatoon-react-meetup/)
* [Toronto, ON](https://www.meetup.com/Toronto-React-Native/events/)

## Chile {/*chile*/}
Expand Down
39 changes: 39 additions & 0 deletions src/content/learn/describing-the-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ React は、ユーザインターフェース(UI)を表示するための Ja

<YouWillLearn isChapter={true}>

<<<<<<< HEAD

Check failure on line 13 in src/content/learn/describing-the-ui.md

View workflow job for this annotation

GitHub Actions / Lint on node 20.x and ubuntu-latest

コンフリクトマーカーが残っています。コンフリクトを解消してください。
* [初めてのコンポーネントの書き方](/learn/your-first-component)
* [コンポーネントファイルを複数に分ける理由とその方法](/learn/importing-and-exporting-components)
* [JSX を使って JavaScript にマークアップを追加する方法](/learn/writing-markup-with-jsx)
Expand All @@ -18,6 +19,17 @@ React は、ユーザインターフェース(UI)を表示するための Ja
* [コンポーネントを条件付きでレンダーする方法](/learn/conditional-rendering)
* [複数のコンポーネントを同時にレンダーする方法](/learn/rendering-lists)
* [コンポーネントを純粋に保つことで混乱を避ける方法](/learn/keeping-components-pure)
=======
* [How to write your first React component](/learn/your-first-component)
* [When and how to create multi-component files](/learn/importing-and-exporting-components)
* [How to add markup to JavaScript with JSX](/learn/writing-markup-with-jsx)
* [How to use curly braces with JSX to access JavaScript functionality from your components](/learn/javascript-in-jsx-with-curly-braces)
* [How to configure components with props](/learn/passing-props-to-a-component)
* [How to conditionally render components](/learn/conditional-rendering)
* [How to render multiple components at a time](/learn/rendering-lists)
* [How to avoid confusing bugs by keeping components pure](/learn/keeping-components-pure)
* [Why understanding your UI as trees is useful](/learn/understanding-your-ui-as-a-tree)
>>>>>>> a0cacd7d3a89375e5689ccfba0461e293bfe9eeb
</YouWillLearn>

Expand Down Expand Up @@ -523,7 +535,34 @@ export default function TeaSet() {

</LearnMore>

<<<<<<< HEAD

Check failure on line 538 in src/content/learn/describing-the-ui.md

View workflow job for this annotation

GitHub Actions / Lint on node 20.x and ubuntu-latest

コンフリクトマーカーが残っています。コンフリクトを解消してください。
## 次のステップ {/*whats-next*/}
=======
## Your UI as a tree {/*your-ui-as-a-tree*/}

React uses trees to model the relationships between components and modules.

A React render tree is a representation of the parent and child relationship between components.

<Diagram name="generic_render_tree" height={250} width={500} alt="A tree graph with five nodes, with each node representing a component. The root node is located at the top the tree graph and is labelled 'Root Component'. It has two arrows extending down to two nodes labelled 'Component A' and 'Component C'. Each of the arrows is labelled with 'renders'. 'Component A' has a single 'renders' arrow to a node labelled 'Component B'. 'Component C' has a single 'renders' arrow to a node labelled 'Component D'.">An example React render tree.</Diagram>

Components near the top of the tree, near the root component, are considered top-level components. Components with no child components are leaf components. This categorization of components is useful for understanding data flow and rendering performance.

Modelling the relationship between JavaScript modules is another useful way to understand your app. We refer to it as a module dependency tree.

<Diagram name="generic_dependency_tree" height={250} width={500} alt="A tree graph with five nodes. Each node represents a JavaScript module. The top-most node is labelled 'RootModule.js'. It has three arrows extending to the nodes: 'ModuleA.js', 'ModuleB.js', and 'ModuleC.js'. Each arrow is labelled as 'imports'. 'ModuleC.js' node has a single 'imports' arrow that points to a node labelled 'ModuleD.js'.">An example module dependency tree.</Diagram>

A dependency tree is often used by build tools to bundle all the relevant JavaScript code for the client to download and render. A large bundle size regresses user experience for React apps. Understanding the module dependency tree is helpful to debug such issues.

<LearnMore path="/learn/understanding-your-ui-as-a-tree">

Read **[Your UI as a Tree](/learn/understanding-your-ui-as-a-tree)** to learn how to create a render and module dependency trees for a React app and how they're useful mental models for improving user experience and performance.

</LearnMore>


## What's next? {/*whats-next*/}
>>>>>>> a0cacd7d3a89375e5689ccfba0461e293bfe9eeb
[初めてのコンポーネント](/learn/your-first-component)に進んで、この章をページごとに読み進めましょう!

Expand Down
17 changes: 17 additions & 0 deletions src/content/learn/preserving-and-resetting-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ state は複数のコンポーネント間で独立しています。React は U

<YouWillLearn>

<<<<<<< HEAD

Check failure on line 13 in src/content/learn/preserving-and-resetting-state.md

View workflow job for this annotation

GitHub Actions / Lint on node 20.x and ubuntu-latest

コンフリクトマーカーが残っています。コンフリクトを解消してください。
* React にはコンポーネント構造がどのように「見える」のか
* React が state の保持とリセットを行うタイミング
* React にコンポーネントの state のリセットを強制する方法
Expand All @@ -36,7 +37,19 @@ React はコンポーネントから UI ツリーを作成し、React DOM はそ
## state はツリー内の位置に結びついている {/*state-is-tied-to-a-position-in-the-tree*/}

コンポーネントに state を与えると、その state はそのコンポーネントの内部で「生存」しているように思えるかもしれません。しかし、実際には state は React の中に保持されています。React は、「UI ツリー内でそのコンポーネントがどの位置にあるか」に基づいて、保持している各 state を正しいコンポーネントに関連付けます。
=======
* When React chooses to preserve or reset the state
* How to force React to reset component's state
* How keys and types affect whether the state is preserved

</YouWillLearn>

## State is tied to a position in the render tree {/*state-is-tied-to-a-position-in-the-tree*/}

React builds [render trees](learn/understanding-your-ui-as-a-tree#the-render-tree) for the component structure in your UI.
>>>>>>> a0cacd7d3a89375e5689ccfba0461e293bfe9eeb
When you give a component state, you might think the state "lives" inside the component. But the state is actually held inside React. React associates each piece of state it's holding with the correct component by where that component sits in the render tree.

以下のコードには `<Counter />` JSX タグは 1 つしかありませんが、それが 2 つの異なる位置にレンダーされています。

Expand Down Expand Up @@ -190,7 +203,11 @@ state の更新
</DiagramGroup>


<<<<<<< HEAD
React は、同じコンポーネントを同じ位置でレンダーしている限り、その state を保持し続けます。これを確認するため、両方のカウンタを増加させてから、"Render the second counter" のチェックボックスのチェックを外して 2 つ目のコンポーネントを削除し、再びチェックを入れて元に戻してみてください。
=======
React will keep the state around for as long as you render the same component at the same position in the tree. To see this, increment both counters, then remove the second component by unchecking "Render the second counter" checkbox, and then add it back by ticking it again:
>>>>>>> a0cacd7d3a89375e5689ccfba0461e293bfe9eeb
<Sandpack>

Expand Down
Loading

0 comments on commit 22f8d0f

Please sign in to comment.