TypeScript 2.6 introduced strictFunctionTypes , and after upgrading, I can't seem to get Redux and React Router to play nice with it and each other. Thus, I'm wondering how best to define the types for a component that is both to be displayed on a certain route, and receive props from Redux.

The following is about how I've set up my application. There's a route like this:

<Route path="/some/path/with/:parameter" component={ConnectedComponent}/>

Then the component that I want to be displayed receives props from both Redux and React Router, which I've tried to capture in the following type signature:

class BareComponent extends React.Component<ReduxProps & RouteProps, ArbitraryState>

...where the Redux props are defined similar to the following:

interface StateProps { storeProperty: string; } interface DispatchProps { dispatchCallback: () => void; } type ReduxProps = StateProps & DispatchProps;

...and the router props somewhat like the following:

interface RouteParams { parameter: string } type RouteProps = RouteComponentProps<RouteParams>;

(where RouteComponentProps is imported from react-router-dom )

The component that is passed to the router (via Route in the first code sample above) is created as follows:

const ConnectedComponent = connect<StateProps, DispatchProps, RouteProps, ArbitraryStateInterface>(mapStateToProps)(BareComponent);

Unfortunately, with strictFunctionTypes , this leads TypeScript to complain that ConnectedComponent is not assignable to the type React Router expects:

TS2322: Type '{ path: "/some/path/with/:parameter"; component: ComponentClass<Pick<StatePr...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Route> & Readonly<{ children?: ReactNode; }> & Rea...'. Type '{ path: "/some/path/with/:parameter"; component: ComponentClass<Pick<StatePr...' is not assignable to type 'Readonly<RouteProps>'. Types of property 'component' are incompatible. Type 'ComponentClass<Pick<StateProps & DispatchProps & RouteC...' is not assignable to type 'StatelessComponent<RouteComponentProps<any> | undefined> | ComponentClass<RouteComponentProps<any...'. Type 'ComponentClass<Pick<StateProps & DispatchProps & RouteC...' is not assignable to type 'ComponentClass<RouteComponentProps<any> | undefined>'. Types of parameters 'props' and 'props' are incompatible. Type 'RouteComponentProps<any> | undefined' is not assignable to type 'Pick<StateProps & DispatchProps & RouteComponentProps<R...'. Type 'undefined' is not assignable to type 'Pick<StateProps & DispatchProps & RouteComponentProps<R...'. Type 'undefined' is not assignable to type 'Pick<StateProps & DispatchProps & RouteComponentProps<R...'.