If function is kept inside the component it will get re-initialised on every render which can be prevented with useCallback but that itself has some cost. Should we keep functions outside the component and pass props, state, state updater functions or whatever is required as arguments?