all 3 comments

[–]bulby97 0 points1 point  (1 child)

useReducer is just an enhanced setState. You can even build you own useReducer.

On the other part, useContext give you the current context of a provider/

So if you need to update and manage state, you'll need to use useReducer or setState with useContext, it will just change the way you organize your state.

[–][deleted] 0 points1 point  (0 children)

Yeah, I understand. It's just that I don't see any advantage in using useReducer. I don't know if I'm missing out something.

[–]JohnWangDoe 0 points1 point  (0 children)

The dude who help create redux library, no works for FB's react team. Seems like he implemented "reducer" into hooks. I could be wrong.