Ref is an attribute to the DOM elements.The primary purpose of the ref is to find DOM elements easily.
The function is called after the DOM element removes from DOM, and it will automatically swipe the memory.
which helps you to increase the access space.