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
{{ message }}
Repository navigation
Commit 2f1019e
Browse filesBrowse the repository at this point in the historyBrowse files
*Pass a form element that is rendered by React. Passing a non-form element, or a form not managed by React, throws an error.
51
-
*`requestFormReset` is intended for Actions and Transitions. If called outside an Action or Transition, React warns in development and performs a synchronous reset.
52
-
*`requestFormReset` is useful when you implement form submission logic yourself (for example with `onSubmit` + `startTransition`) and still want React's form reset behavior.
53
-
*This API requests a reset for uncontrolled form fields. For controlled fields, handle resets by updating state, such as in `onReset`.
50
+
*React가 렌더링한 폼 엘리먼트를 전달하세요. 폼이 아닌 엘리먼트나 React가 관리하지 않는 폼을 전달하면 오류가 발생합니다.
51
+
*`requestFormReset`은 Action과 Transition에서 사용하기 위한 것입니다. Action이나 Transition 밖에서 호출하면 React는 폼을 동기적으로 초기화하고 개발 환경에서는 경고를 표시합니다.
52
+
*`requestFormReset`은 폼 제출 로직을 직접 구현하면서도(예: `onSubmit` + `startTransition`) React의 폼 초기화 동작을 사용하고 싶을 때 유용합니다.
53
+
*이 API는 비제어 폼 필드의 초기화를 요청합니다. 제어 필드는 `onReset` 등에서 State를 업데이트하여 초기화하세요.
54
54
55
55
---
56
56
57
-
## Usage {/*usage*/}
57
+
## 사용법 {/*usage*/}
58
58
59
-
### Requesting a reset in a custom form Action {/*requesting-a-reset-in-a-custom-form-action*/}
59
+
### 사용자 정의 폼 Action에서 초기화 요청하기 {/*requesting-a-reset-in-a-custom-form-action*/}
60
60
61
-
React [automatically resets uncontrolled fields after a successful `<form action={...}>`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`.
61
+
React는 [`<form action={...}>`제출이 성공하면 비제어 필드를 자동으로 초기화합니다](/reference/react-dom/components/form#handle-form-submission-with-an-action-prop). 제출을 직접 구현할 때는 `requestFormReset`을 호출하여 같은 동작을 적용할 수 있습니다.
62
62
63
63
```js
64
64
import { startTransition } from'react';
@@ -80,10 +80,10 @@ function SearchForm() {
80
80
return (
81
81
<form onSubmit={onSubmit}>
82
82
<input name="query" defaultValue="react"/>
83
-
<button type="submit">Search</button>
83
+
<button type="submit">검색</button>
84
84
</form>
85
85
);
86
86
}
87
87
```
88
88
89
-
If your submission uses the built-in `<form action={...}>` behavior, you don't need to call `requestFormReset` manually.
89
+
`<form action={...}>`의 내장 제출 동작을 사용한다면 `requestFormReset`을 따로 호출할 필요가 없습니다.
0 commit comments