@@ -229,7 +229,7 @@ import { startTransition } from "react";
229229
230230export 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
15801580function 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";
19731973import Total from " ./Total" ;
19741974
19751975export 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
20022002export 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