Upstream the useful definition to the preact repo.
preact-utils.ts
// todo: consider upstreaming type definition for AnyComponent export type AnyComponent<PropsType, StateType> = | FunctionalComponent<PropsType> | ComponentConstructor<PropsType, StateType>;
Also upstream the change to use the new preact definition on preact-router, which also needed to re-define it itself as seen on:
https://github.com/developit/preact-router/blob/master/src/index.d.ts#L51-L53