Here is the sandbox example of mine where I have achieved the same without using either useReferesh and useEffect.
https://codesandbox.io/s/affectionate-carlos-bc2qe?file=/src/App.js
It will work because whenever we change any sate using useState in function component or this.setState in-class component react update rerender the component automatically.

Here is the sandbox example of mine where I have achieved the same without using either useReferesh and useEffect.
https://codesandbox.io/s/affectionate-carlos-bc2qe?file=/src/App.js
It will work because whenever we change any sate using useState in function component or this.setState in-class component react update rerender the component automatically.
