Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clear an error? #100

Open
hakubo opened this issue Jan 13, 2020 · 0 comments
Open

How to clear an error? #100

hakubo opened this issue Jan 13, 2020 · 0 comments

Comments

@hakubo
Copy link

hakubo commented Jan 13, 2020

I have a

const [
  getData, { error }
] = useLazyAxios({
  url: `path`,
});

and when an error occurs I'd love to show a dialog sth like this:

<Button onClick={() => getData()}>Get Data</Button>
<Dialog
  open={!!error}
  onClose={/* how to close the dialog now? */}
>
...content...
</Dialog>

now I'd love to add the onClose handler to let a user close the dialog, but how to do this?
Is making a successful request the only way to clear the error?

@hakubo hakubo changed the title How to clear error? How to clear an error? Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant