Код: Выделить всё
const [deleteDeck, { loading }] = useMutation(DELETE_DECK, {
onCompleted() { (Navigate("/decks")) },
onError: (error) => { setError(error.graphQLErrors[0].message)}
});
< /code>
Мутация завершена успешно, но я получаю следующую ошибку: < /p>
Invalid hook call. Hooks can only be called inside of the body of a function component.
Подробнее здесь: https://stackoverflow.com/questions/796 ... e-mutation