React components do not leak memory because they render frequently. They leak when something outside React keeps running after the component should be gone. Timers are one of the easiest ways to create that bug because setInterval and setTimeout live in the browser event system, not in React's component lifecycle.
If the component unmounts, the interval still fires. That means the callback, the captured state, and any work triggered by refreshData() can stay alive longer than intended.