+ 2
Why am i getting the error Age is not defined? [Solved]
I am using immer library produce function in reducer which I think is causing error ,maybe because of improper usage ,can anyone help me by pointing out what I might be doing wrong ?Ty! https://code.sololearn.com/W0kIypG3TN5n/?ref=app
2 Answers
+ 4
Tiny fix:
Line 56: return inner.Produce(...)
Abhay The reducer must return the next state.
+ 3
Kevin â
thanks a lot Kevin ,I went through so many tutorials but didn't noticed anyone returning immer!!
Edit:oh ok thks ,also I see now that others were using arrow function without curly brackets so it was automatically returning the new state