---
title: "Comment by Anwar Hossain on \"Understanding the Power of useRef: Preventing Infinite Renders and Differences from useState in React\" | Hashnode"
description: "There is an issue with the process. If UI doesn&#39;t rerender, we will not be able to see the latest value of the count variable by using useRef. As a result,"
url: "https://hashnode.com/posts/understanding-the-power-of-useref-preventing-infinite-renders-and-differences-from-usestate-in-react/64e7637091e7499d92c5e678/comment/64e8350dd47513fefda68215"
---

[Discussion](https://hashnode.com/posts/understanding-the-power-of-useref-preventing-infinite-renders-and-differences-from-usestate-in-react/64e7637091e7499d92c5e678)

Comment [Understanding the Power of useRef: Preventing Infinite Renders and Differences from useState in React](https://hashnode.com/posts/understanding-the-power-of-useref-preventing-infinite-renders-and-differences-from-usestate-in-react/64e7637091e7499d92c5e678)

[Anwar Hossain](https://hashnode.com/@anwarhossain)

[Aug 25, 2023](https://hashnode.com/posts/understanding-the-power-of-useref-preventing-infinite-renders-and-differences-from-usestate-in-react/64e7637091e7499d92c5e678/comment/64e8350dd47513fefda68215)

There is an issue with the process. If UI doesn't rerender, we will not be able to see the latest value of the count variable by using useRef. As a result, with the increment and decrement value of the count will be updated but for not rerendering the ui, we won't see it's latest value.

[Debasmit Biswal](https://hashnode.com/@Deb1)

[Aug 25, 2023](https://hashnode.com/posts/understanding-the-power-of-useref-preventing-infinite-renders-and-differences-from-usestate-in-react/64e7637091e7499d92c5e678/comment/64e8350dd47513fefda68215#reply-64e8366dcddf12fecdfca8b9)

If you want to render it you can pass the dependency in useEffect. useRef will render once every time if the dependency of useEffect changes. As a result you can see the latest value accordingly.
