-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
I'm facing a situation where I need to hide error from mutation.
In React Query there is a mutation.reset method that would do that.
Are there ways to achieve something similar?
const CreateTodo = () => {
const [create, { error }] = useCreateMutation()
const onCreateTodo = () => {
create({ /* ... */ })
}
const hideError = () => {
// mutation.reset() ?
}
return (
<form onSubmit={onCreateTodo}>
{error && <h5 onClick={hideError}>{error}</h5>}
// ...
<button type="submit">Create Todo</button>
</form>
)
}Metadata
Metadata
Assignees
Labels
No labels