Skip to content

Commit 79d9323

Browse files
committed
error msg cleaner
1 parent 7946aac commit 79d9323

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/src/Pages/NotesPage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ function NotesPage() {
3939
if (error === 'Нет авторизации') auth.logout()
4040
clearError()
4141
// eslint-disable-next-line react-hooks/exhaustive-deps
42-
}, [error, clearError])
42+
}, [error])
43+
44+
/** очистка message */
45+
React.useEffect(() => {
46+
return () => message && setMessage(null)
47+
})
4348

4449
/**Подключение хука id кудактируемой заметки */
4550
const { editNoteId, setEditNoteId, unsetEditNoteId } = useEditNoteId()

0 commit comments

Comments
 (0)