software developer and a data analyst who loves learning and taking on challenging tasks to develop dynamic and user friendly websites and applications
software developer and a data analyst who loves learning and taking on challenging tasks to develop dynamic and user friendly websites and applications
Top comments (4)
Good one but I think spread operator is the best way to update react state in such case
I understand there are a couple of ways to achieve the same, I just wanted to make it basic. Thank You.
You should look into useReducer. It's an alternative to useState but for more complex objects like what you have here.
Thank you. However I just wanted to keep it basic, but i will consider useReducer too as a Scale up for the article.