diff --git a/src/components/NewCommentForm.tsx b/src/components/NewCommentForm.tsx index 3d8b9ec96..cfe56b512 100644 --- a/src/components/NewCommentForm.tsx +++ b/src/components/NewCommentForm.tsx @@ -58,7 +58,7 @@ export const NewCommentForm: React.FC = ({ loader, onAdd }) => { return; } - onAdd(newComment); + await onAdd(newComment); setNewComment(prevComment => ({ ...prevComment, body: '' })); setTouched({ name: false, email: false, body: false }); }; diff --git a/src/components/PostDetails.tsx b/src/components/PostDetails.tsx index 8954fb7e2..6c3f13a81 100644 --- a/src/components/PostDetails.tsx +++ b/src/components/PostDetails.tsx @@ -14,7 +14,7 @@ type Props = { export const PostDetails: React.FC = ({ currPost, openModal, - setOpenModal = () => {}, + setOpenModal, }) => { const [comments, setComments] = useState([]); const [error, setError] = useState(false); diff --git a/src/components/PostsList.tsx b/src/components/PostsList.tsx index fd193cd8f..0b3b2e74a 100644 --- a/src/components/PostsList.tsx +++ b/src/components/PostsList.tsx @@ -12,8 +12,8 @@ type Props = { export const PostsList: React.FC = ({ posts, currPost, - setOpenModal = () => {}, - setCurrPost = () => {}, + setOpenModal, + setCurrPost, }) => { const onOpenPost = (post: Post) => { const isSamePost = currPost && currPost?.id === post.id; diff --git a/src/components/UserSelector.tsx b/src/components/UserSelector.tsx index cbb1572c2..0e43e60b5 100644 --- a/src/components/UserSelector.tsx +++ b/src/components/UserSelector.tsx @@ -11,7 +11,7 @@ type Props = { export const UserSelector: React.FC = ({ users, currUser, - setCurrUser = () => {}, + setCurrUser, }) => { const [menuIsVisible, setMenuIsVisible] = useState(false);