Skip to content

Commit 600955a

Browse files
authored
docs: update reusing-logic-with-custom-hooks.md (#1410)
<!-- PR을 보내주셔서 감사합니다! 여러분과 같은 기여자들이 React를 더욱 멋지게 만듭니다! 기존 이슈와 관련된 PR이라면, 아래에 이슈 번호를 추가해주세요. --> closes #1409 # reusing-logic-with-custom-hooks.md 파일 수정 <!-- 어떤 종류의 PR인지 상세 내용을 작성해주세요. --> 번역이 빠진 부분들 추가 번역하였습니다. ## 필수 확인 사항 - [x] [기여자 행동 강령 규약<sup>Code of Conduct</sup>](https://github.com/reactjs/ko.react.dev/blob/main/CODE_OF_CONDUCT.md) - [x] [기여 가이드라인<sup>Contributing</sup>](https://github.com/reactjs/ko.react.dev/blob/main/CONTRIBUTING.md) - [x] [공통 스타일 가이드<sup>Universal Style Guide</sup>](https://github.com/reactjs/ko.react.dev/blob/main/wiki/universal-style-guide.md) - [x] [번역을 위한 모범 사례<sup>Best Practices for Translation</sup>](https://github.com/reactjs/ko.react.dev/blob/main/wiki/best-practices-for-translation.md) - [x] [번역 용어 정리<sup>Translate Glossary</sup>](https://github.com/reactjs/ko.react.dev/blob/main/wiki/translate-glossary.md) - [x] [`textlint` 가이드<sup>Textlint Guide</sup>](https://github.com/reactjs/ko.react.dev/blob/main/wiki/textlint-guide.md) - [x] [맞춤법 검사<sup>Spelling Check</sup>](https://nara-speller.co.kr/speller/) ## 선택 확인 사항 - [ ] 번역 초안 작성<sup>Draft Translation</sup> - [ ] 리뷰 반영<sup>Resolve Reviews</sup> Co-authored-by: Jaem <91131509+DarkChocoJaem@users.noreply.github.com>
1 parent ae8926d commit 600955a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/learn/reusing-logic-with-custom-hooks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ export default function ChatRoom({ roomId }) {
836836
837837
### 커스텀 Hook에 이벤트 핸들러 넘겨주기 {/*passing-event-handlers-to-custom-hooks*/}
838838
839-
As you start using `useChatRoom` in more components, you might want to let components customize its behavior. For example, currently, the logic for what to do when a message arrives is hardcoded inside the Hook:
839+
더 많은 컴포넌트에서 `useChatRoom`을 사용하기 시작하면, 컴포넌트가 그 동작을 커스텀할 수 있도록 하고 싶을 수 있습니다. 예를 들어, 현재 메시지가 도착했을 때 무엇을 할지에 대한 로직은 Hook 내부에 하드 코딩되어 있습니다.
840840
841841
```js {9-11}
842842
export function useChatRoom({ serverUrl, roomId }) {
@@ -1001,7 +1001,7 @@ export function useChatRoom({ serverUrl, roomId, onReceiveMessage }) {
10011001
10021002
```js src/chat.js
10031003
export function createConnection({ serverUrl, roomId }) {
1004-
// A real implementation would actually connect to the server
1004+
// 실제 구현에서는 서버에 연결됩니다
10051005
if (typeof serverUrl !== 'string') {
10061006
throw Error('Expected serverUrl to be a string. Received: ' + serverUrl);
10071007
}
@@ -1248,7 +1248,7 @@ function ChatRoom({ roomId }) {
12481248
function ChatRoom({ roomId }) {
12491249
const [serverUrl, setServerUrl] = useState('https://localhost:1234');
12501250

1251-
//Great: custom Hooks named after their purpose
1251+
//좋은 예시: 목적에 따라 이름이 지어진 커스텀 Hook
12521252
useChatRoom({ serverUrl, roomId });
12531253
useImpressionLog('visit_chat', { roomId });
12541254
// ...
@@ -1778,7 +1778,7 @@ export class FadeInAnimation {
17781778
if (progress === 1) {
17791779
this.stop();
17801780
} else {
1781-
// We still have more frames to paint
1781+
// 아직 더 그릴 프레임이 있습니다
17821782
this.frameId = requestAnimationFrame(() => this.onFrame());
17831783
}
17841784
}
@@ -1915,7 +1915,7 @@ export default function Counter() {
19151915
```
19161916
19171917
```js src/useCounter.js
1918-
// Write your custom Hook in this file!
1918+
// 이 파일에 커스텀 Hook을 작성하세요!
19191919
```
19201920
19211921
</Sandpack>
@@ -2102,7 +2102,7 @@ export function useCounter(delay) {
21022102
```
21032103
21042104
```js src/useInterval.js
2105-
// Hook을 여기에 작성하세요!
2105+
// 이 파일에 커스텀 Hook을 작성하세요!
21062106
```
21072107
21082108
</Sandpack>

0 commit comments

Comments
 (0)