Skip to content

Commit 21b9bf9

Browse files
authored
Update PostForm.js
1 parent 82c0a92 commit 21b9bf9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ch4/front/components/PostForm.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ const PostForm = () => {
2323
const onSubmitForm = useCallback(() => {
2424
dispatch({
2525
type: ADD_POST_REQUEST,
26-
data: {
27-
text,
28-
},
26+
data: text,
2927
});
30-
}, []);
28+
}, [text]);
3129

3230
const onChangeText = useCallback((e) => {
3331
setText(e.target.value);

0 commit comments

Comments
 (0)