Skip to content
New issue

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

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

Already on GitHub? # to your account

Access error value but it's undefined #284

Open
guilhermebayerzup opened this issue Jul 28, 2020 · 0 comments
Open

Access error value but it's undefined #284

guilhermebayerzup opened this issue Jul 28, 2020 · 0 comments

Comments

@guilhermebayerzup
Copy link

guilhermebayerzup commented Jul 28, 2020

Describe the bug
I'm normalizing the error code from the response with a message and I need to access this error inside the promise then, to do some more things, more in some cases the error from useFetch destructuring was undefined. I think its more a question than a bug maybe.

⚠️ Make a Codesandbox ⚠️
https://codesandbox.io/s/silly-napier-wxs53?file=/src/App.js

To Reproduce
Steps to reproduce the behavior:
2. Click on submit button
3. See console.log from error variable on line 37, some cases it's undefined, the one on line 41 always comes with the error value

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant