diff --git a/src/content/reference/react-dom/requestFormReset.md b/src/content/reference/react-dom/requestFormReset.md index cd99a904a..d1c59768d 100644 --- a/src/content/reference/react-dom/requestFormReset.md +++ b/src/content/reference/react-dom/requestFormReset.md @@ -4,7 +4,7 @@ title: requestFormReset -`requestFormReset` lets you reset a React-managed form after an Action or Transition finishes. +`requestFormReset`을 사용하면 Action이나 Transition이 끝난 후 React가 관리하는 폼을 초기화할 수 있습니다. ```js requestFormReset(form) @@ -16,11 +16,11 @@ requestFormReset(form) --- -## Reference {/*reference*/} +## 레퍼런스 {/*reference*/} ### `requestFormReset(form)` {/*requestformreset*/} -Call `requestFormReset` to request that a form resets after the current Action or Transition completes. +현재 Action이나 Transition이 완료된 후 폼이 초기화되도록 요청하려면 `requestFormReset`을 호출하세요. ```js import { startTransition } from 'react'; @@ -35,30 +35,30 @@ function handleSubmit(form) { } ``` -[See more examples below.](#usage) +[아래 예시를 참고하세요.](#usage) -#### Parameters {/*parameters*/} +#### 매개변수 {/*parameters*/} -* `form`: an [HTML form element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement) rendered by React. +* `form`: React가 렌더링한 [HTML 폼 엘리먼트](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement)입니다. -#### Returns {/*returns*/} +#### 반환값 {/*returns*/} -`requestFormReset` returns nothing. +`requestFormReset`은 아무것도 반환하지 않습니다. -#### Caveats {/*caveats*/} +#### 주의 사항 {/*caveats*/} -* Pass a form element that is rendered by React. Passing a non-form element, or a form not managed by React, throws an error. -* `requestFormReset` is intended for Actions and Transitions. If called outside an Action or Transition, React warns in development and performs a synchronous reset. -* `requestFormReset` is useful when you implement form submission logic yourself (for example with `onSubmit` + `startTransition`) and still want React's form reset behavior. -* This API requests a reset for uncontrolled form fields. For controlled fields, handle resets by updating state, such as in `onReset`. +* React가 렌더링한 폼 엘리먼트를 전달하세요. 폼이 아닌 엘리먼트나 React가 관리하지 않는 폼을 전달하면 오류가 발생합니다. +* `requestFormReset`은 Action과 Transition에서 사용하도록 만들어졌습니다. Action이나 Transition 외부에서 호출하면 React는 개발 환경에서 경고를 표시하고 폼을 동기적으로 초기화합니다. +* `requestFormReset`은 폼 제출 로직을 직접 구현하면서도(예를 들어 `onSubmit` + `startTransition`) React의 폼 초기화 동작을 그대로 사용하고 싶을 때 유용합니다. +* 이 API는 비제어 폼 필드의 초기화를 요청합니다. 제어 필드는 `onReset` 등에서 State를 업데이트하여 초기화를 처리하세요. --- -## Usage {/*usage*/} +## 사용법 {/*usage*/} -### Requesting a reset in a custom form Action {/*requesting-a-reset-in-a-custom-form-action*/} +### 커스텀 폼 Action에서 초기화 요청하기 {/*requesting-a-reset-in-a-custom-form-action*/} -React [automatically resets uncontrolled fields after a successful `
` submission](/reference/react-dom/components/form#handle-form-submission-with-an-action-prop). When you implement submission manually, you can opt into the same behavior by calling `requestFormReset`. +React는 [`` 제출이 성공하면 비제어 필드를 자동으로 초기화합니다](/reference/react-dom/components/form#handle-form-submission-with-an-action-prop). 제출을 직접 구현하는 경우에도 `requestFormReset`을 호출하면 동일한 동작을 사용할 수 있습니다. ```js import { startTransition } from 'react'; @@ -80,10 +80,10 @@ function SearchForm() { return ( - +
); } ``` -If your submission uses the built-in `
` behavior, you don't need to call `requestFormReset` manually. +내장된 `` 동작으로 제출을 처리한다면 `requestFormReset`을 직접 호출할 필요가 없습니다.