useCallback hook is used for performance optimization and to cache something.
When do we use useCallback?
It is used to freeze a function reference.
See, whenever a component renders, all the functions of the component are created.Therefore, when a c...