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
6 changes: 3 additions & 3 deletions src/content/reference/react/useImperativeHandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ input {

---

### 사용자 정의 Imperative 메서드 노출 {/*exposing-your-own-imperative-methods*/}
### 사용자 정의 명령형 메서드 노출 {/*exposing-your-own-imperative-methods*/}

Imperative Handle을 통해 노출하는 메서드는 DOM 메서드와 정확하게 일치할 필요가 없습니다. 예를 들어, 이 `Post` 컴포넌트는 Imperative Handle을 통해 `scrollAndFocusAddComment` 메서드를 표시합니다. 이렇게 하면 부모 `Page`에서 버튼을 클릭할 때 댓글 목록을 스크롤하고 입력 필드에 초점을 맞출 수 있습니다.
`Imperative Handle`을 통해 노출하는 메서드는 DOM 메서드와 정확하게 일치할 필요가 없습니다. 예를 들어, 이 `Post` 컴포넌트는 `Imperative Handle`을 통해 `scrollAndFocusAddComment` 메서드를 표시합니다. 이렇게 하면 부모 `Page`에서 버튼을 클릭할 때 댓글 목록을 스크롤하고 입력 필드에 초점을 맞출 수 있습니다.

<Sandpack>

Expand Down Expand Up @@ -287,5 +287,5 @@ export default AddComment;

**Ref를 과도하게 사용하지 마세요.** Ref는 Props로 표현할 수 없는 필수적인 행동에만 사용해야 합니다. 예를 들어 특정 노드로 스크롤 하기, 노드에 초점 맞추기, 애니메이션 실행하기, 텍스트 선택하기 등이 있습니다.

**Prop으로 표현할 수 있는 것에 Ref를 사용하지 마세요.** 예를 들어 `Modal` 컴포넌트에서 `{ open, close }`와 같은 Imperative Handle을 노출하는 대신 `<Modal isOpen={isOpen} />`과 같은 `isOpen` Prop을 사용하는 것이 더 좋습니다. [Effect](/learn/synchronizing-with-effects)를 사용하면 Prop을 통해 명령형 동작<sup>Imperative Behavior</sup>을 노출할 수 있습니다.
**Prop으로 표현할 수 있는 것에 Ref를 사용하지 마세요.** 예를 들어 `Modal` 컴포넌트에서 `{ open, close }`와 같은 `Imperative Handle`을 노출하는 대신 `<Modal isOpen={isOpen} />`과 같은 `isOpen` Prop을 사용하는 것이 더 좋습니다. [Effect](/learn/synchronizing-with-effects)를 사용하면 Prop을 통해 명령형 동작<sup>Imperative Behavior</sup>을 노출할 수 있습니다.
</Pitfall>
18 changes: 18 additions & 0 deletions textlint/data/rules/translateGlossary.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,24 @@ module.exports = {
note: '',
},
},
{
sources: [/\bUsage\b/],
target: '사용법',
meta: {
term: 'Usage',
discussions: [1425],
note: '',
},
},
{
sources: [/\bImperative\b/],
target: '명령형',
meta: {
term: 'Imperative',
discussions: [1425],
note: '',
},
},
],
},
// untranslated: {
Expand Down
2 changes: 2 additions & 0 deletions wiki/translate-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ Caveats|`/\bCaveats?\b/`, `/주의사항/`|주의 사항|[#1095](https://github.
Logic|`/\bLogic\b/`|로직|[#695](https://github.com/reactjs/ko.react.dev/issues/695)||
Dependency|`/\bDependenc(?:y\|ies)\b/`|의존성|[#841](https://github.com/reactjs/ko.react.dev/issues/841)||
Directive|`/\bDirectives?\b/`|지시어|[#819](https://github.com/reactjs/ko.react.dev/issues/819)||
Usage|`/\bUsage\b/`|사용법|[#1425](https://github.com/reactjs/ko.react.dev/issues/1425)||
Imperative|`/\bImperative\b/`|명령형|[#1425](https://github.com/reactjs/ko.react.dev/issues/1425)||