What is useReducer hook in React? #9
Answered
by
HarshitKumar9030
PranthRaval
asked this question in
Q&A
-
What is useReducer hook in React?Please tell me about it I found it really hard to understand |
Beta Was this translation helpful? Give feedback.
Answered by
HarshitKumar9030
Jul 21, 2022
Replies: 1 comment
-
Hii Pranth, useReducer is basically an alternative to useState, It accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method. (If you’re familiar with Redux, you already know how this works.) You can refer to these url's to know more,
Thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PranthRaval
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hii Pranth, useReducer is basically an alternative to useState, It accepts a reducer of type (state, action) => newState, and returns the current state paired with a dispatch method. (If you’re familiar with Redux, you already know how this works.)
You can refer to these url's to know more,
Thanks