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/docs/code-splitting.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@ const App = () => (
225
225
226
226
## Named Exports {#named-exports}
227
227
228
-
`React.lazy`는 현재 default exports만 지원합니다. named exports를 사용하고자 한다면 default로 이름을 재정의한 중간 모듈을 생성할 수 있습니다. 이렇게 하면 treeshaking이 계속 동작하고 사용하지 않는 컴포넌트는 가져오지 않습니다.
228
+
`React.lazy`는 현재 default exports만 지원합니다. named exports를 사용하고자 한다면 default로 이름을 재정의한 중간 모듈을 생성할 수 있습니다. 이렇게 하면 tree shaking이 계속 동작하고 사용하지 않는 컴포넌트는 가져오지 않습니다.
Copy file name to clipboardExpand all lines: content/docs/faq-functions.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ class Foo extends Component {
83
83
84
84
>**Note:**
85
85
>
86
-
>Using an arrow function in render creates a new function each time the component renders, which may have performance implications (see below).
86
+
>Using an arrow function in render creates a new function each time the component renders, which may break optimizations based on strict identity comparison.
87
87
88
88
### Is it OK to use arrow functions in render methods? {#is-it-ok-to-use-arrow-functions-in-render-methods}
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
+
Virtual DOM (VDOM)은 UI의 이상적인 또는 "가상"적인 표현을 메모리에 저장하고 ReactDOM과 같은 라이브러리에 의해 "실제" DOM과 동기화하는 프로그래밍 개념입니다. 이 과정을 [재조정](/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를 가능하게 합니다. React에게 원하는 UI의 상태를 알려주면 이는 DOM이 그 상태와 일치하도록 합니다. 이러한 방식은 앱 구축에 사용해야 하는 어트리뷰트 조작, 이벤트 처리, 수동 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.
15
+
"virtual DOM"은 특정 기술이라기보다는 패턴에 가깝기 때문에 사람들은 때때로 다른 것을 의미한다고 이야기합니다. React의 세계에서 "virtual DOM"이라는 용어는 보통 사용자 인터페이스를 나타내는 객체이기 때문에 [React elements](/docs/rendering-elements.html)와 연관됩니다. 그러나 React는 컴포넌트 트리에 대한 추가 정보를 포함하기 위해 "fibers"라는 내부 객체를 사용합니다. 또한 React에서 "virtual DOM" 구현의 일부로 간주할 수 있습니다.
16
16
17
-
### Is the Shadow DOM the same as the Virtual DOM? {#is-the-shadow-dom-the-same-as-the-virtual-dom}
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은 주로 웹 컴포넌트의 범위 지정 변수 및 CSS용으로 설계된 브라우저 기술입니다. virtual DOM은 브라우저 API 위에 있는 JavaScript 라이브러리에서 구현되는 개념입니다.
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의 새로운 재조정 엔진입니다. 이 프로그램의 주요 목표는 virtual DOM의 증분 렌더링을 활성화하는 것입니다. [더 읽기](https://github.com/acdlite/react-fiber-architecture).
Copy file name to clipboardExpand all lines: content/docs/getting-started.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ React 문서는 Javascript 프로그래밍에 익숙한 사람을 대상으로
99
99
100
100
### 고급 개념 {#advanced-concepts}
101
101
102
-
[주요 개념](#main-concepts)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html) 및 [refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.
102
+
[주요 개념](/docs/hello-world.html)에 익숙해지고 React를 더 많이 다루게 되면 보다 고급 주제에 관심을 가지게 될 것입니다. 이 섹션에서는 [context](/docs/context.html) 및 [refs](/docs/refs-and-dom.html)와 같이 강력하지만 일반적으로 사용되지는 않는 React 기능을 소개합니다.
Copy file name to clipboardExpand all lines: content/docs/hooks-effect.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -333,7 +333,7 @@ function FriendStatusWithCounter(props) {
333
333
}
334
334
```
335
335
336
-
**Hooks lets us split the code based on what it is doing** rather than a lifecycle method name. React will apply *every* effect used by the component, in the order they were specified.
336
+
**Hooks let us split the code based on what it is doing** rather than a lifecycle method name. React will apply *every* effect used by the component, in the order they were specified.
337
337
338
338
### Explanation: Why Effects Run on Each Update {#explanation-why-effects-run-on-each-update}
339
339
@@ -473,7 +473,7 @@ In the future, the second argument might get added automatically by a build-time
473
473
>
474
474
>If you use this optimization, make sure the array includes **all values from the component scope (such as props and state) that change over time and that are used by the effect**. Otherwise, your code will reference stale values from previous renders. Learn more about [how to deal with functions](/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies) and [what to do when the array changes too often](/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often).
475
475
>
476
-
>If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array (`[]`) as a second argument. This tells React that your effect doesn't depend on *any* values from props or state, so it never needs to re-run. This isn't handled as a special case -- it follows directly from how the inputs array always works.
476
+
>If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array (`[]`) as a second argument. This tells React that your effect doesn't depend on *any* values from props or state, so it never needs to re-run. This isn't handled as a special case -- it follows directly from how the dependencies array always works.
477
477
>
478
478
>If you pass an empty array (`[]`), the props and state inside the effect will always have their initial values. While passing `[]` as the second argument is closer to the familiar `componentDidMount` and `componentWillUnmount` mental model, there are usually [better](/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies) [solutions](/docs/hooks-faq.html#what-can-i-do-if-my-effect-dependencies-change-too-often) to avoid re-running effects too often. Also, don't forget that React defers running `useEffect` until after the browser has painted, so doing extra work is less of a problem.
Copy file name to clipboardExpand all lines: content/docs/hooks-faq.md
+7-10
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ There are a few more heuristics, and they might change over time as we fine-tune
209
209
210
210
*`componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
211
211
212
-
### How can I do data fetching with Hooks?
212
+
### How can I do data fetching with Hooks? {#how-can-i-do-data-fetching-with-hooks}
213
213
214
214
Here is a [small demo](https://codesandbox.io/s/jvvkoo8pq3) to get you started. To learn more, check out [this article](https://www.robinwieruch.de/react-hooks-fetch-data/) about data fetching with Hooks.
215
215
@@ -654,7 +654,7 @@ function ProductDetails({ fetchProduct })
654
654
655
655
Note that in the above example we **need** to keep the function in the dependencies list. This ensures that a change in the `productId` prop of `ProductPage` automatically triggers a refetch in the `ProductDetails` component.
656
656
657
-
### What can I do if my effect dependencies change too often?
657
+
### What can I do if my effect dependencies change too often? {#what-can-i-do-if-my-effect-dependencies-change-too-often}
658
658
659
659
Sometimes, your effect may be using reading state that changes too often. You might be tempted to omit that state from a list of dependencies, but that usually leads to bugs:
660
660
@@ -740,7 +740,7 @@ The [`useMemo`](/docs/hooks-reference.html#usememo) Hook lets you cache calculat
This code calls `computeExpensiveValue(a, b)`. But if the inputs`[a, b]` haven't changed since the last value, `useMemo` skips calling it a second time and simply reuses the last value it returned.
743
+
This code calls `computeExpensiveValue(a, b)`. But if the dependencies`[a, b]` haven't changed since the last value, `useMemo` skips calling it a second time and simply reuses the last value it returned.
744
744
745
745
Remember that the function passed to `useMemo` runs during rendering. Don't do anything there that you wouldn't normally do while rendering. For example, side effects belong in `useEffect`, not `useMemo`.
746
746
@@ -767,7 +767,7 @@ Note that this approach won't work in a loop because Hook calls [can't](/docs/ho
767
767
768
768
### How to create expensive objects lazily? {#how-to-create-expensive-objects-lazily}
769
769
770
-
`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.
770
+
`useMemo` lets you [memoize an expensive calculation](#how-to-memoize-calculations) if the dependencies 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.
771
771
772
772
**The first common use case is when creating the initial state is expensive:**
773
773
@@ -809,13 +809,10 @@ function Image(props) {
809
809
810
810
// ✅ IntersectionObserver is created lazily once
811
811
functiongetObserver() {
812
-
let observer =ref.current;
813
-
if (observer !==null) {
814
-
return observer;
812
+
if (ref.current===null) {
813
+
ref.current=newIntersectionObserver(onIntersect);
815
814
}
816
-
let newObserver =newIntersectionObserver(onIntersect);
0 commit comments