-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I am using Typescript v4.0.2 and I am getting a type error when trying to use third party middleware that uses the NextFunction type from @types/express.
Culprit code:
// Next & NextFunction are not compatable and no way to overwrite with generic
type Next<T = void> = (err?: Error | null) => T;
type RequestHandler<T, U, V = void> = (req: T, res: U, next: Next<V>) => V;I recommend something like:
type RequestHandler<TRequest, TResponse, TNext, TReturn> = (req: TRequest, res: TResponse, next: TNext) => TReturn;menocomp, bard, pito-svk and WoodyWoodsta
Metadata
Metadata
Assignees
Labels
No labels