Something to watch out for when using a single useState hook, you want to pay attention and make sure it doesn't cause re-renders for the entire form whenever you update a single field. A project I worked on a while back suffered from massive performance issues due to re-renders.
That’s a great addition Sunny, thanks for that! And you‘re absolutely right. For a large form with a lot of input fields this could be an absolute performance nightmare. I think you always have to look closely and re-evaluate it for your individual usecase. For my small example here I think it’s alright.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Something to watch out for when using a single useState hook, you want to pay attention and make sure it doesn't cause re-renders for the entire form whenever you update a single field. A project I worked on a while back suffered from massive performance issues due to re-renders.
That’s a great addition Sunny, thanks for that! And you‘re absolutely right. For a large form with a lot of input fields this could be an absolute performance nightmare. I think you always have to look closely and re-evaluate it for your individual usecase. For my small example here I think it’s alright.