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.
Anwar Hossain
I am a software engineer. I like to talk and think about Reactjs, Nextjs and Javascript. Also I like to think regarding software engineering
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.