DEV Community


Discussion on: useReducer instead of useState while calling APIs!

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 😇

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