Skip to content

Commit bff367f

Browse files
authored
docs: translate remaining English comments in useTransition reference (#1532)
<!-- PR을 보내주셔서 감사합니다! 여러분과 같은 기여자들이 React를 더욱 멋지게 만듭니다! 기존 이슈와 관련된 PR이라면, 아래에 이슈 번호를 추가해주세요. --> # <!-- 제목을 작성해주세요. --> translate remaining English comments in useTransition reference <!-- 어떤 종류의 PR인지 상세 내용을 작성해주세요. --> `reference/react/useTransition` 페이지의 예시코드 중에 일부 주석이 영문 그대로 남아 있었습니다. 같은 페이지의 다른 예시에는 이미 번역된 동일/유사 주석이 있어, 그 표현에 맞춰 일관되게 번역했습니다. ```diff - // To expose an action prop, await the callback in startTransition. + // action prop을 노출하려면 startTransition 내부 콜백에서 await 하세요. - // await the action that's passed in. - // This allows it to be either sync or async. + // 전달받은 action을 await 합니다. + // 이렇게 하면 동기든 비동기든 모두 처리할 수 있습니다. - // For demonstration purposes to show Error Boundary + // Error Boundary를 보여주기 위한 예시입니다. - // Intentionally not passing a comment - // so error gets thrown + // 의도적으로 comment를 전달하지 않아 + // 에러가 발생하도록 합니다. - // Store the actual quantity in separate state to show the mismatch. + // 불일치를 보여주기 위해 실제 수량을 별도의 state에 저장합니다. - // Return the new quantity to update the state + // state를 업데이트하기 위해 새로운 수량을 반환합니다. - // Initial quantity + // 초기 수량 - // Update the quantity in an Action. + // 수량을 업데이트하는 Action입니다. - // Simulate every other request being slower + // 매번 다른 요청이 더 느리게 반환되도록 시뮬레이션합니다. ``` ## 필수 확인 사항 - [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>
1 parent 3c6c2a5 commit bff367f

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/content/reference/react/useTransition.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ import { startTransition } from "react";
229229

230230
export default function Item({action}) {
231231
function handleChange(event) {
232-
// To expose an action prop, await the callback in startTransition.
232+
// action prop을 노출하려면 startTransition 내부 콜백에서 await 하세요.
233233
startTransition(async () => {
234234
await action(event.target.value);
235235
})
@@ -598,8 +598,8 @@ export default function TabButton({ action, children, isActive }) {
598598
return (
599599
<button onClick={() => {
600600
startTransition(async () => {
601-
// await the action that's passed in.
602-
// This allows it to be either sync or async.
601+
// 전달받은 action을 await 합니다.
602+
// 이렇게 하면 동기든 비동기든 모두 처리할 수 있습니다.
603603
await action();
604604
});
605605
}}>
@@ -665,8 +665,8 @@ export default function TabButton({ action, children, isActive }) {
665665
return (
666666
<button onClick={async () => {
667667
startTransition(async () => {
668-
// await the action that's passed in.
669-
// This allows it to be either sync or async.
668+
// 전달받은 action을 await 합니다.
669+
// 이렇게 하면 동기든 비동기든 모두 처리할 수 있습니다.
670670
await action();
671671
});
672672
}}>
@@ -1578,7 +1578,7 @@ export function AddCommentContainer() {
15781578
}
15791579

15801580
function addComment(comment) {
1581-
// For demonstration purposes to show Error Boundary
1581+
// Error Boundary를 보여주기 위한 예시입니다.
15821582
if (comment == null) {
15831583
throw new Error("Example Error: An error thrown to trigger error boundary");
15841584
}
@@ -1592,8 +1592,8 @@ function AddCommentButton() {
15921592
disabled={pending}
15931593
onClick={() => {
15941594
startTransition(() => {
1595-
// Intentionally not passing a comment
1596-
// so error gets thrown
1595+
// 의도적으로 comment를 전달하지 않아
1596+
// 에러가 발생하도록 합니다.
15971597
addComment();
15981598
});
15991599
}}
@@ -1973,15 +1973,15 @@ import Item from "./Item";
19731973
import Total from "./Total";
19741974

19751975
export default function App({}) {
1976-
// Store the actual quantity in separate state to show the mismatch.
1976+
// 불일치를 보여주기 위해 실제 수량을 별도의 state에 저장합니다.
19771977
const [clientQuantity, setClientQuantity] = useState(1);
19781978
const [quantity, updateQuantityAction, isPending] = useActionState(
19791979
async (prevState, payload) => {
19801980
setClientQuantity(payload);
19811981
const savedQuantity = await updateQuantity(payload);
1982-
return savedQuantity; // Return the new quantity to update the state
1982+
return savedQuantity; // state를 업데이트하기 위해 새로운 수량을 반환합니다.
19831983
},
1984-
1 // Initial quantity
1984+
1 // 초기 수량
19851985
);
19861986

19871987
return (
@@ -2001,7 +2001,7 @@ import {startTransition} from 'react';
20012001

20022002
export default function Item({action}) {
20032003
function handleChange(e) {
2004-
// Update the quantity in an Action.
2004+
// 수량을 업데이트하는 Action입니다.
20052005
startTransition(() => {
20062006
action(e.target.value);
20072007
});
@@ -2057,7 +2057,7 @@ export async function updateQuantity(newName) {
20572057
setTimeout(() => {
20582058
firstRequest = true;
20592059
resolve(newName);
2060-
// Simulate every other request being slower
2060+
// 매번 다른 요청이 더 느리게 반환되도록 시뮬레이션합니다.
20612061
}, 1000);
20622062
} else {
20632063
setTimeout(() => {

0 commit comments

Comments
 (0)