Skip to content

Commit 2443e56

Browse files
authored
Modify AddTask to use onAddTask prop
Updated AddTask component to accept onAddTask prop.
1 parent 673fc14 commit 2443e56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/learn/scaling-up-with-reducer-and-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ export default function TaskList() {
696696
`tasks` 리스트를 업데이트하기 위해서 컴포넌트에서 context의 `dispatch` 함수를 읽고 호출할 수 있습니다.
697697
698698
```js {3,9-13}
699-
export default function AddTask() {
699+
export default function AddTask({ onAddTask }) {
700700
const [text, setText] = useState('');
701701
const dispatch = useContext(TasksDispatchContext);
702702
// ...
@@ -785,7 +785,7 @@ export const TasksDispatchContext = createContext(null);
785785
import { useState, useContext } from 'react';
786786
import { TasksDispatchContext } from './TasksContext.js';
787787

788-
export default function AddTask() {
788+
export default function AddTask({ onAddTask }) {
789789
const [text, setText] = useState('');
790790
const dispatch = useContext(TasksDispatchContext);
791791
return (

0 commit comments

Comments
 (0)