DEV Community

loading...

Discussion on: useReducer instead of useState while calling APIs!

Collapse
ms_yogii profile image
Yogini Bende Author

If you don't need to use it outside the hook, there is no harm in declaring it inside. The only purpose of declaring a function there is to enable async-await. But again.. its our choice 😇

Collapse
yukiyohure profile image
Yuki Shibata

That makes sense!
Thank you for answering🙌

Some comments have been hidden by the post's author - find out more

Forem Open with the Forem app