score:0

after some trouble i was able to get this to work!

// assuming all these interfaces are well defined somewhere.
type mycomponentprops = ownprops & composeprops & stateprops & dispatchprops;

// the secret sauce, need to define a class constructor to pass to compose
interface mycomponentclass<mycomponentprops> extends react.componentclass {
  new (props: mycomponentprops): react.component<mycomponentprops>;
}

export class mycomponent extends react.component<mycomponentprops> {
  ...
}

export default compose<mycomponentclass<mycomponentprops>>(
  withsomehoc(),
  connect<stateprops, dispatchprops, ownprops>(mapstatetoprops, mapdispatchtoprops)
)(mycomponent);

the above will allow you to import the composed component and maintain type safety!

score:2

i do it this way:

import { compose } from 'redux';

then:

export default compose<react.componentclass>(
  withrouter,
  connect<imapstatetoprops, imapdispatchtoprops, iconnectedrouterprops>(
    mapstatetoprops,
    {
      fetchcomponentdata
    },
  ),
)(component);

Related Query

More Query from same tag