DEV Community

Cover image for React Hooks - useReducer

React Hooks - useReducer

Andrew on March 28, 2021

I have a YouTube video where I go into more detail. I explain the reducer function in greater depth there as well. What is it? The ...
Collapse
 
jotsarupsingh profile image
jotsarup-singh

i call it mini version of redux.

Collapse
 
reactifystudio profile image
Reactify

So can I ditch redux and use this stuff alone?

Collapse
 
techcheck profile image
Andrew • Edited

Good question. Redux is great for combining multiple reducers. (and combining all the dispatched actions to work together). It's also good for injecting middleware for developer tools and performing asynchronous tasks (fetch data, etc..) inside actions. I might have to add an edit to the blog πŸ€”πŸ‘.

Thread Thread
 
reactifystudio profile image
Reactify

What others do I need I hear of thunk redux and such.but I don't know much about it. I've used context API alone

Thread Thread
 
reactifystudio profile image
Reactify

I see other stuff like redux thunk. Can you advise me on everything I need for redux. I'll have 100 code days in Frontend (react and Firebase)
.

Collapse
 
jotsarupsingh profile image
jotsarup-singh

@reactifystudio it can be used in small medium size projects but for large application its difficult to manage.

Thread Thread
 
reactifystudio profile image
Reactify

Okay thanks. And which other tools you use in React?.

Collapse
 
techcheck profile image
Andrew

That's how I think of it πŸ˜‚

Collapse
 
petrtcoi profile image
Petr Tcoi

Is there any naming convention for components with useDispatch from react-redux?

const dispatch = useDispatch()
and
const [state, dispatch] = useReducer(reducer, initialState)

Collapse
 
kleguizamon profile image
Kevin Leguizamon

Hey man, greats tutorial πŸ‘

Collapse
 
techcheck profile image
Andrew

Thanks! πŸ™

Collapse
 
devoskar profile image
Oskar Pietrucha

Nice tutorial, thanks! I'm gonna implement it in my projects

Collapse
 
techcheck profile image
Andrew

My pleasure! Awesome to hear!

Collapse
 
techcheck profile image
Andrew

I could see that. Good call

Collapse
 
vanaroth_aya profile image
Vanaroth

Very good post, thank you.

Collapse
 
techcheck profile image
Andrew

Thank you πŸ™

Collapse
 
alpinstang profile image
John McDonald

Great article! Hooks are the best thing since functional components in React!

Collapse
 
techcheck profile image
Andrew

Thanks! Agreed!

Collapse
 
ical10 profile image
Husni Rizal

Thanks! Clear and concise, just what I needed.

Collapse
 
techcheck profile image
Andrew

Thanks! πŸ™

Collapse
 
dhan46code profile image
dhan46code

Greatt, i like this article

Collapse
 
spyda247 profile image
Babajide Ibiayo

Awesome!!! Thanks. I enjoyed the video so much that I coded each line and then went ahead to build an express API server to fetch random quotes off a mongoDb database running on my laptop.

Collapse
 
techcheck profile image
Andrew

That's so awesome to hear!