nada-abuzaid / sora-dashboard-front

0 stars 0 forks source link

useReducer instead of mulitple useState #19

Open amjed-98 opened 2 years ago

amjed-98 commented 2 years ago

great work separating the chart logic into a hook, but I would prefer that you use useReducer because it's better for handling rerenders when multiple states are triggered at once and for I believe it would be much cleaner readable

image

same thing here in admin file:

image

nada-abuzaid commented 2 years ago

Thank you Amjad for your review, I don't know what is useReducer before, but now I've learned a new thing, thanks again!