You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/2015-08-11-relay-technical-preview.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ While React simplified the process of developing complex user-interfaces, it lef
13
13
14
14
Declarative data-fetching means that Relay applications specify *what* data they need, not *how* to fetch that data. Just as React uses a description of the desired UI to manage view updates, Relay uses a data description in the form of GraphQL queries. Given these descriptions, Relay coalesces queries into batches for efficiency, manages error-prone asynchronous logic, caches data for performance, and automatically updates views as data changes.
15
15
16
-
Relay is also component-oriented, extending the notion of a React component to include a description of what data is necessary to render it. This colocation allows developers to reason locally about their application and eliminates bugs such as under- or over-fetching data.
16
+
Relay is also component-oriented, extending the notion of a React component to include a description of what data is necessary to render it. This collocation allows developers to reason locally about their application and eliminates bugs such as under- or over-fetching data.
17
17
18
18
Relay is in use at Facebook in production apps, and we're using it more and more because *Relay lets developers focus on their products and move fast*. It's working for us and we'd like to share it with the community.
Copy file name to clipboardExpand all lines: content/docs/addons-test-utils.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ Pass a mocked component module to this method to augment it with useful methods
139
139
140
140
> Note:
141
141
>
142
-
> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/test-utils.html#shallow-rendering) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
142
+
> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/shallow-renderer.html) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead.
### What is the Virtual DOM? {#what-is-the-virtual-dom}
9
+
### 仮想 DOM とは? {#what-is-the-virtual-dom}
10
10
11
-
The virtual DOM (VDOM) is a programming concept where an ideal, or "virtual", representation of a UI is kept in memory and synced with the "real" DOM by a library such as ReactDOM. This process is called [reconciliation](/docs/reconciliation.html).
11
+
仮想 DOM (virtual DOM; VDOM) は、インメモリに保持された想像上のまたは「仮想の」UI 表現が、ReactDOM のようなライブラリによって「実際の」DOM と同期されるというプログラミング上の概念です。このプロセスは[差分検出処理 (reconciliation)](/docs/reconciliation.html)と呼ばれます。
12
12
13
-
This approach enables the declarative API of React: You tell React what state you want the UI to be in, and it makes sure the DOM matches that state. This abstracts out the attribute manipulation, event handling, and manual DOM updating that you would otherwise have to use to build your app.
13
+
このアプローチにより React の宣言型 API が可能になっています。あなたは UI をどのような状態にしたいのか React に伝え、React は必ず DOM をその状態と一致させます。これにより、React なしではアプリケーションを構築するために避けて通れない属性の操作やイベントハンドリング、および手動での DOM 更新が抽象化されます。
14
14
15
-
Since "virtual DOM" is more of a pattern than a specific technology, people sometimes say it to mean different things. In React world, the term "virtual DOM" is usually associated with [React elements](/docs/rendering-elements.html)since they are the objects representing the user interface. React, however, also uses internal objects called "fibers" to hold additional information about the component tree. They may also be considered a part of "virtual DOM" implementation in React.
### Is the Shadow DOM the same as the Virtual DOM? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
17
+
### Shadow DOM は仮想 DOM と同じもの? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
18
18
19
-
No, they are different. The Shadow DOM is a browser technology designed primarily for scoping variables and CSS in web components. The virtual DOM is a concept implemented by libraries in JavaScript on top of browser APIs.
19
+
いいえ、違います。Shadow DOM は、本来 web components において変数や CSS をスコープ化するために設計されたブラウザ技術です。仮想 DOM は JavaScript のライブラリによってブラウザ API の上に実装された概念です。
20
20
21
-
### What is "React Fiber"? {#what-is-react-fiber}
21
+
### 「React Fiber」とは? {#what-is-react-fiber}
22
22
23
-
Fiber is the new reconciliation engine in React 16. Its main goal is to enable incremental rendering of the virtual DOM. [Read more](https://github.com/acdlite/react-fiber-architecture).
23
+
Fiber は React 16 の新しい差分検出処理エンジンです。その主な目的は仮想 DOM の逐次レンダーを可能にすることです。[さらに読む](https://github.com/acdlite/react-fiber-architecture)
Copy file name to clipboardExpand all lines: content/docs/hooks-faq.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -466,7 +466,7 @@ Note that this approach won't work in a loop because Hook calls [can't](/docs/ho
466
466
467
467
### How to create expensive objects lazily? {#how-to-create-expensive-objects-lazily}
468
468
469
-
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the inputs are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes need to be sure an object is only created once.
469
+
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the inputs are the same. However, it only serves as a hint, and doesn't *guarantee* the computation won't re-run. But sometimes you need to be sure an object is only created once.
470
470
471
471
**The first common use case is when creating the initial state is expensive:**
472
472
@@ -560,7 +560,7 @@ In large component trees, an alternative we recommend is to pass down a `dispatc
560
560
const TodosDispatch = React.createContext(null);
561
561
562
562
function TodosApp() {
563
-
// Tip: `dispatch` won't change between re-renders
563
+
// Note: `dispatch` won't change between re-renders
Copy file name to clipboardExpand all lines: content/docs/static-type-checking.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -216,10 +216,18 @@ Congrats! You've installed the latest version of TypeScript into your project. I
216
216
```
217
217
218
218
### Configuring the TypeScript Compiler {#configuring-the-typescript-compiler}
219
-
The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file run:
219
+
The compiler is of no help to us until we tell it what to do. In TypeScript, these rules are defined in a special file called `tsconfig.json`. To generate this file:
220
+
221
+
If you use [Yarn](https://yarnpkg.com/), run:
222
+
223
+
```bash
224
+
yarn run tsc --init
225
+
```
226
+
227
+
If you use [npm](https://www.npmjs.com/), run:
220
228
221
229
```bash
222
-
tsc --init
230
+
npx tsc --init
223
231
```
224
232
225
233
Looking at the now generated `tsconfig.json`, you can see that there are many options you can use to configure the compiler. For a detailed description of all the options, check [here](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
Copy file name to clipboardExpand all lines: content/docs/strict-mode.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ React used to support `findDOMNode` to search the tree for a DOM node given a cl
57
57
58
58
`findDOMNode` can also be used on class components but this was breaking abstraction levels by allowing a parent to demand that certain children was rendered. It creates a refactoring hazard where you can't change the implementation details of a component because a parent might be reaching into its DOM node. `findDOMNode` only returns the first child, but with the use of Fragments, it is possible for a component to render multiple DOM nodes. `findDOMNode` is a one time read API. It only gave you an answer when you asked for it. If a child component renders a different node, there is no way to handle this change. Therefore `findDOMNode` only worked if components always return a single DOM node that never changes.
59
59
60
-
You can instead make this explicit by pass a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
60
+
You can instead make this explicit by passing a ref to your custom component and pass that along to the DOM using [ref forwarding](/docs/forwarding-refs.html#forwarding-refs-to-dom-components).
61
61
62
62
You can also add a wrapper DOM node in your component and attach a ref directly to it.
0 commit comments