DEV Community

loading...

Fetch using useReducer!

jackent2b profile image Jayant Khandelwal ・1 min read

In this post, we will gonna see how to make a Fetch request with the help of the useReducer hook.

This is our reducer function,

Alt Text

Let's have a look at our functional component,

Alt Text

Complete Code:

Alt Text

I hope it might help you!

Happy coding!

-Jayant khandelwal

Discussion (0)

pic
Editor guide