From 450d70f1f68833cb7bcd92c542fd68d7b247f2bb Mon Sep 17 00:00:00 2001 From: LEE SUK JAE Date: Wed, 27 Mar 2019 13:40:25 +0900 Subject: [PATCH 1/3] Translated docs/faq-ajax into Korean --- content/docs/faq-ajax.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/content/docs/faq-ajax.md b/content/docs/faq-ajax.md index 102e1c07e..c2235e14b 100644 --- a/content/docs/faq-ajax.md +++ b/content/docs/faq-ajax.md @@ -1,24 +1,24 @@ --- id: faq-ajax -title: AJAX and APIs +title: AJAX 와 APIs permalink: docs/faq-ajax.html layout: docs category: FAQ --- -### How can I make an AJAX call? {#how-can-i-make-an-ajax-call} +### 어떻게 AJAX 호출을 만들 수 있을까요? {#how-can-i-make-an-ajax-call} -You can use any AJAX library you like with React. Some popular ones are [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), and the browser built-in [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). +당신이 좋아하는 AJAX 라이브러리들을 React와 함께 사용할 수 있습니다. 유명한 라이브러리로는 [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), 그리고 브라우저에 내장된 [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) 등이 있습니다. -### Where in the component lifecycle should I make an AJAX call? {#where-in-the-component-lifecycle-should-i-make-an-ajax-call} +### 컴포넌트의 생명주기 중 어느 부분에서 AJAX 호출을 만들 수 있나요? {#where-in-the-component-lifecycle-should-i-make-an-ajax-call} -You should populate data with AJAX calls in the [`componentDidMount`](/docs/react-component.html#mounting) lifecycle method. This is so you can use `setState` to update your component when the data is retrieved. +AJAX 호출을 통한 데이터는 생명주기 메서드 중 [`componentDidMount`](/docs/react-component.html#mounting) 안에 채워져야 합니다. 이는 데이터를 받아 올 때 `setState`를 통하여 컴포넌트를 업데이트하기 위함입니다. -### Example: Using AJAX results to set local state {#example-using-ajax-results-to-set-local-state} +### 예시: 로컬 스테이트(state)를 설정하기 위해 AJAX 결과 사용하기 {#example-using-ajax-results-to-set-local-state} -The component below demonstrates how to make an AJAX call in `componentDidMount` to populate local component state. +아래 컴포넌트는 로컬 컴포넌트의 스테이트를 채우기 위하여 `componentDidMount` 안에서 어떻게 AJAX 호출을 만드는지 보여 줍니다. -The example API returns a JSON object like this: +API 예시는 다음과 같은 JSON 객체를 반환합니다. ``` { @@ -50,9 +50,9 @@ class MyComponent extends React.Component { items: result.items }); }, - // Note: it's important to handle errors here - // instead of a catch() block so that we don't swallow - // exceptions from actual bugs in components. + // 주의: 컴포넌트들의 실제 버그로부터 오는 예외사항들을 넘기지 않도록 + // 에러들을 catch() 블록(block)에서 처리하기보다는 + // 이 부분에서 처리하는 것이 중요합니다. (error) => { this.setState({ isLoaded: true, From 4c18c51fa38ff8c50fe281c90891394e337996ce Mon Sep 17 00:00:00 2001 From: LEE SUK JAE Date: Wed, 27 Mar 2019 18:52:15 +0900 Subject: [PATCH 2/3] Made a correction to reflect request. https://github.com/reactjs/ko.reactjs.org/pull/80\#discussion_r269469209 --- content/docs/faq-ajax.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/faq-ajax.md b/content/docs/faq-ajax.md index c2235e14b..761f769aa 100644 --- a/content/docs/faq-ajax.md +++ b/content/docs/faq-ajax.md @@ -6,17 +6,17 @@ layout: docs category: FAQ --- -### 어떻게 AJAX 호출을 만들 수 있을까요? {#how-can-i-make-an-ajax-call} +### 어떻게 AJAX 호출을 할 수 있을까요? {#how-can-i-make-an-ajax-call} -당신이 좋아하는 AJAX 라이브러리들을 React와 함께 사용할 수 있습니다. 유명한 라이브러리로는 [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), 그리고 브라우저에 내장된 [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) 등이 있습니다. +당신이 선호하는 AJAX 라이브러리를 React와 함께 사용할 수 있습니다. 유명한 라이브러리로는 [Axios](https://github.com/axios/axios), [jQuery AJAX](https://api.jquery.com/jQuery.ajax/), 그리고 브라우저에 내장된 [window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) 등이 있습니다. -### 컴포넌트의 생명주기 중 어느 부분에서 AJAX 호출을 만들 수 있나요? {#where-in-the-component-lifecycle-should-i-make-an-ajax-call} +### 컴포넌트의 생명주기 중 어디에서 AJAX 호출을 할 수 있나요? {#where-in-the-component-lifecycle-should-i-make-an-ajax-call} -AJAX 호출을 통한 데이터는 생명주기 메서드 중 [`componentDidMount`](/docs/react-component.html#mounting) 안에 채워져야 합니다. 이는 데이터를 받아 올 때 `setState`를 통하여 컴포넌트를 업데이트하기 위함입니다. +AJAX 호출을 통한 데이터는 생명주기 메서드 중 [`componentDidMount`](/docs/react-component.html#mounting) 안에 추가되어야 합니다. 이는 데이터를 받아 올 때 `setState`를 통하여 컴포넌트를 업데이트하기 위함입니다. ### 예시: 로컬 스테이트(state)를 설정하기 위해 AJAX 결과 사용하기 {#example-using-ajax-results-to-set-local-state} -아래 컴포넌트는 로컬 컴포넌트의 스테이트를 채우기 위하여 `componentDidMount` 안에서 어떻게 AJAX 호출을 만드는지 보여 줍니다. +아래 컴포넌트는 로컬 컴포넌트의 state를 채우기 위하여 `componentDidMount` 안에서 어떻게 AJAX 호출을 만드는지 보여 줍니다. API 예시는 다음과 같은 JSON 객체를 반환합니다. @@ -50,8 +50,8 @@ class MyComponent extends React.Component { items: result.items }); }, - // 주의: 컴포넌트들의 실제 버그로부터 오는 예외사항들을 넘기지 않도록 - // 에러들을 catch() 블록(block)에서 처리하기보다는 + // 주의: 컴포넌트의 실제 버그에서 발생하는 예외사항들을 넘기지 않도록 + // 에러를 catch() 블록(block)에서 처리하기보다는 // 이 부분에서 처리하는 것이 중요합니다. (error) => { this.setState({ From 4c3a195f242f48df8e8defb21aec41749e9ed7d6 Mon Sep 17 00:00:00 2001 From: Ilkwon Sim Date: Wed, 27 Mar 2019 18:56:37 +0900 Subject: [PATCH 3/3] Update faq-ajax.md --- content/docs/faq-ajax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/faq-ajax.md b/content/docs/faq-ajax.md index 761f769aa..1b2ea44af 100644 --- a/content/docs/faq-ajax.md +++ b/content/docs/faq-ajax.md @@ -14,7 +14,7 @@ category: FAQ AJAX 호출을 통한 데이터는 생명주기 메서드 중 [`componentDidMount`](/docs/react-component.html#mounting) 안에 추가되어야 합니다. 이는 데이터를 받아 올 때 `setState`를 통하여 컴포넌트를 업데이트하기 위함입니다. -### 예시: 로컬 스테이트(state)를 설정하기 위해 AJAX 결과 사용하기 {#example-using-ajax-results-to-set-local-state} +### 예시: 로컬 state를 설정하기 위해 AJAX 결과 사용하기 {#example-using-ajax-results-to-set-local-state} 아래 컴포넌트는 로컬 컴포넌트의 state를 채우기 위하여 `componentDidMount` 안에서 어떻게 AJAX 호출을 만드는지 보여 줍니다.