In ReactJS components I frequently see callbacks corresponding to UI events (eg. onFormSubmit) being added to the props object via the connect library.
Why is this done? Surely if onFormSubmit is created and only used by that component, it can be either private or added directly to the component?
Is it for testability reasons?
Edit: is it because access to the dispatch function of the store is controlled and made accessible via connect to avoid a component taking a dependency on the store?