I have the counter component. I encapsulated the business logic with custom hook. Should I optimize functions by means useCallback
? If there is input onchange handler, will the situation be the same?
const increment = () => {
setCount(count + 1);
};
↓
const increment = useCallback(() => {
setCount(count + 1);
}, [count]);