next-routes
next-routes copied to clipboard
Wrong typings for customHandler
From the readme and the code, I can see that custom handler provided to the getRequestHandler
accepts an object
const handler = routes.getRequestHandler(app, ({req, res, route, query}) => {
app.render(req, res, route.page, query)
})
But in type definitions, the type of the handler differs:
export type HTTPHandler = (
request: IncomingMessage,
response: ServerResponse
) => void
so that TS fails to compile