Skip to content

Commit 2c8580b

Browse files
committed
docs: update content/learn/state-a-components-memory.md
1 parent ea17947 commit 2c8580b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/content/learn/state-a-components-memory.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,9 +1450,7 @@ export default function FeedbackForm() {
14501450

14511451
#### 불필요한 state 제거하기 {/*remove-unnecessary-state*/}
14521452

1453-
이 예시에서 버튼이 클릭 되면 사용자의 이름을 요청하고 그런 다음 환영 메시지를 표시해야 합니다. 이름을 유지하기 위해 state를 사용하려고 했지만, 어떤 이유로 항상 "Hello, !"라고 표시됩니다.
1454-
1455-
When the button is clicked, this example should ask for the user's name and then display an alert greeting them. You tried to use state to keep the name, but for some reason the first time it shows "Hello, !", and then "Hello, [name]!" with the previous input every time after.
1453+
이 예시에서 버튼을 클릭하면 사용자의 이름을 요청한 후 그 이름으로 환영 메시지를 표시해야 합니다. 이름을 유지하기 위해 state를 사용하려고 했지만, 첫 번째에는 항상 "Hello, !"라고 표시되고 그다음부터는 항상 "Hello, [이전 입력값]!"이 나옵니다.
14561454

14571455
이 코드를 수정하려면 불필요한 state 변수를 제거하세요. ([왜 이것이 작동하지 않는지](/learn/state-as-a-snapshot)에 대해서는 나중에 설명하겠습니다.)
14581456

0 commit comments

Comments
 (0)