Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed public/images/tutorial/codesandbox-devtools.png
Binary file not shown.
Binary file added public/images/tutorial/components-tab.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/tutorial/devtools-inspect.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/tutorial/devtools-select.gif
Binary file not shown.
Binary file added public/images/tutorial/sandbox-new-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ButtonLink({
className,
'active:scale-[.98] transition-transform inline-flex font-bold items-center outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark leading-snug',
{
'bg-link text-white dark:bg-brand-dark dark:text-secondary hover:bg-opacity-80':
'bg-link text-white dark:bg-brand-dark dark:text-gray-90 hover:bg-opacity-80':
type === 'primary',
'text-primary dark:text-primary-dark shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
type === 'secondary',
Expand Down
19 changes: 17 additions & 2 deletions src/content/learn/tutorial-tic-tac-toe.md
Original file line number Diff line number Diff line change
Expand Up @@ -903,19 +903,34 @@

### React 개발자 도구 {/*react-developer-tools*/}

<<<<<<< HEAD

Check failure on line 906 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `<<<<<<<` is not allowed
React 개발자 도구를 사용하면 React 컴포넌트의 Props와 State를 확인할 수 있습니다. CodeSandBox의 _브라우저_ 구역 하단에서 React 개발자 도구 탭을 찾을 수 있습니다.

![CodeSandbox의 React 개발자 도구](../images/tutorial/codesandbox-devtools.png)

화면에서 특정 컴포넌트를 검사하려면 React 개발자 도구의 왼쪽 위 모서리에 있는 버튼을 사용하세요.

![React 개발자 도구로 페이지의 컴포넌트 선택하기](../images/tutorial/devtools-select.gif)
=======

Check failure on line 914 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `=======` is not allowed
React Developer Tools let you check the props and the state of your React components. It is available as a [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/), and [Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) browser extension.

<Note>
After you install it, a new *Components* tab will appear in your browser Developer Tools for sites using React. If you're following along in CodeSandbox, you'd need to first open your sandbox preview in a new tab:

![opening in new tab](../images/tutorial/sandbox-new-tab.png)

Then, on the preview page, open your browser's DevTools and find the *Components* tab:
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd

Check failure on line 922 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `>>>>>>>` is not allowed

![components tab](../images/tutorial/components-tab.png)

<<<<<<< HEAD

Check failure on line 926 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `<<<<<<<` is not allowed
로컬 환경에서 개발하는 경우, React 개발자 도구는 [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/), 그리고 [Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) 브라우저의 확장 프로그램으로 사용할 수 있습니다. 설치 후 브라우저 개발자 도구에 React를 사용하는 사이트를 위한 *Components* 탭이 나타납니다.
=======

Check failure on line 928 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `=======` is not allowed
To inspect a particular component on the screen, use the button in the top left corner of the Components tab:

![inspecting with devtools](../images/tutorial/devtools-inspect.gif)
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd

Check failure on line 932 in src/content/learn/tutorial-tic-tac-toe.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `>>>>>>>` is not allowed

</Note>

## 게임 완료하기 {/*completing-the-game*/}

Expand Down
44 changes: 44 additions & 0 deletions src/content/reference/react-dom/components/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,53 @@

## 사용법 {/*usage*/}

<<<<<<< HEAD

Check failure on line 51 in src/content/reference/react-dom/components/form.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `<<<<<<<` is not allowed
### 클라이언트에서 폼 제출 처리하기 {/*handle-form-submission-on-the-client*/}

폼이 제출될 때 함수를 실행하기 위해, 폼의 `action` 프로퍼티에 함수를 전달하세요. [`formData`](https://developer.mozilla.org/ko/docs/Web/API/FormData)가 함수에 인수로 전달되어, 폼에서 전달된 데이터에 접근할 수 있습니다. 이 점이 URL만 받던 기존 [HTML action](https://developer.mozilla.org/ko/docs/Web/HTML/Element/form)과의 차이점입니다. After the `action` function succeeds, all uncontrolled field elements in the form are reset.
=======

Check failure on line 55 in src/content/reference/react-dom/components/form.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `=======` is not allowed
### Handle form submission with an event handler {/*handle-form-submission-with-an-event-handler*/}

Pass a function to the `onSubmit` event handler to run code when the form is submitted. By default, the browser sends the form data to the current URL and refreshes the page, so call [`e.preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) to override that behavior.

This example reads the submitted values with [`new FormData(e.target)`](https://developer.mozilla.org/en-US/docs/Web/API/FormData), which collects every field by its `name`. This keeps the inputs [uncontrolled](/reference/react-dom/components/input#reading-the-input-values-when-submitting-a-form). If you instead [control an input with state](/reference/react-dom/components/input#controlling-an-input-with-a-state-variable), read from that state on submit rather than from `FormData`.

<Sandpack>

```js src/App.js
export default function Search() {
function handleSubmit(e) {
// Prevent the browser from reloading the page
e.preventDefault();

// Read the form data
const form = e.target;
const formData = new FormData(form);
const query = formData.get("query");
alert(`You searched for '${query}'`);
}

return (
<form onSubmit={handleSubmit}>
<input name="query" />
<button type="submit">Search</button>
</form>
);
}
```

</Sandpack>

<Note>

Reading form data with `onSubmit` works in every version of React and gives you direct access to the [submit event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event), so you can call `e.preventDefault()` and read the data yourself. Passing the function to the `action` prop instead runs the submission in a [Transition](/reference/react/useTransition). React then tracks the pending state, sends thrown errors to the nearest error boundary, and lets the form work with [`useActionState`](/reference/react/useActionState) and [`useOptimistic`](/reference/react/useOptimistic). An `action` can also be a [Server Function](/reference/rsc/server-functions), which `onSubmit` does not support.

</Note>

### Handle form submission with an action prop {/*handle-form-submission-with-an-action-prop*/}

Pass a function to the `action` prop of form to run the function when the form is submitted. [`formData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) will be passed to the function as an argument so you can access the data submitted by the form. This differs from the conventional [HTML action](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#action), which only accepts URLs. Unlike `onSubmit`, an `action` runs in a [Transition](/reference/react/useTransition) and calling `e.preventDefault()` isn't needed. After the `action` function succeeds, all uncontrolled field elements in the form are reset.
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd

Check failure on line 97 in src/content/reference/react-dom/components/form.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `>>>>>>>` is not allowed

<Sandpack>

Expand Down
4 changes: 4 additions & 0 deletions src/content/reference/react/Component.md
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,11 @@

#### 주의 사항 {/*static-getderivedstatefromprops-caveats*/}

<<<<<<< HEAD

Check failure on line 1012 in src/content/reference/react/Component.md

View workflow job for this annotation

GitHub Actions / Lint

Git conflict marker `<<<<<<<` is not allowed
- 이 메서드는 원인에 관계없이 *모든* 렌더링에서 호출됩니다. 이는 부모가 다시 렌더링을 일으킬 때만 발동하고 로컬 `setState`의 결과가 아닐 때만 발동하는 [`UNSAFE_componentWillReceiveProps`](#unsafe_cmoponentwillreceiveprops)와는 다릅니다.
=======
- This method is fired on *every* render, regardless of the cause. This is different from [`UNSAFE_componentWillReceiveProps`](#unsafe_componentwillreceiveprops), which only fires when the parent causes a re-render and not as a result of a local `setState`.
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd

- 이 메서드에는 컴포넌트 인스턴스에 대한 액세스 권한이 없습니다. 원하는 경우 클래스 정의 외부 컴포넌트 props 및 state의 순수 함수를 추출하여 `static getDerivedStateFromProps`와 다른 클래스 메서드 사이에 일부 코드를 재사용할 수 있습니다.

Expand Down
Loading
Loading