---
title: "Comment by Anmol Jhamb on \"A Beginner guide to Mastering Re-rendering in React\" | Hashnode"
description: "Hey! It was a great article! I just started out with React just last month. and I had a small doubt, would it be better to use a useRef hook when I have a form"
url: "https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63da732a4d93226420f6605e"
---

[Discussion](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d)

Comment [A Beginner guide to Mastering Re-rendering in React](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d)

[Anmol Jhamb](https://hashnode.com/@heyitsanmolj)

[Feb 1, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63da732a4d93226420f6605e)

Hey! It was a great article! I just started out with React just last month. and I had a small doubt, would it be better to use a useRef hook when I have a form with around 5 or 6 fields? It doesn't re-render the component, right? but if we only need the value of the inputs onSubmit, so do we really need to re-render them? I am a beginner so I don't really know if it would be a good approach or not. I'd really appreciate your thoughts on this!

[Atharva Bhuse](https://hashnode.com/@atharvabhuse)

[Feb 1, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63da732a4d93226420f6605e#reply-63daa36ab7131763ef1af2f1)

Hello Anmol, I would be happy to help you with that. Yes, you are right. useRef() does not re-render the component but it is still preferable to use useState() hook because it keeps component up-to-date with latest state. Even if you need value of the inputs on submit of the form, I will suggest to use useState() hook because it provides a better control on each input value change and corresponding behavior of submit button. For example you can display error messages and disable submit button if user is entering wrong input value. I would like to suggest you Formik and Yup libraries for state management and validating form inputs in React. Thanks Anmol for your question, have a great day!!

[Anmol Jhamb](https://hashnode.com/@heyitsanmolj)

[Feb 1, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63da732a4d93226420f6605e#reply-63daa60db7131763ef1af363)

Thanks for recommending the libraries!! I'll be sure to use them the next time I have to manage a frame. Also, do you have a blog that details all the basic 10 react hooks? [Atharva Bhuse](https://hashnode.com/@atharvabhuse)

[Atharva Bhuse](https://hashnode.com/@atharvabhuse)

[Feb 1, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63da732a4d93226420f6605e#reply-63dab69b1699246a25c21cfb)

I don't have blog on this topic right now, but I will definitely consider your suggestion. Thanks Anmol
