Closed Howard86 closed 3 years ago
Bug fix: fix incorrect type declaration of NextApiRequestWithMiddleware
NextApiRequestWithMiddleware
when using router.use, it will not allow to inject middleware type definition
router.use
e.g. can use the following (optional)
type User = { name: string } router.use<User>(req => ({name: "USER"})) router.get(req: NextApiRequestWithMiddleware<User> => req.middlware.name)
Bug fix: fix incorrect type declaration of
NextApiRequestWithMiddleware
when using
router.use
, it will not allow to inject middleware type definitione.g. can use the following (optional)