Thanks a lot! nc().use() requires the function arg to be compatible with the props it receives. If you can't make it work out of the box, you may need to wrap it:
Yeah my original code didn't work, that's a good way to put it. I just wouldn't call it router to avoid confusion, because it's just a handler, the router being managed inside Next core :).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks a lot!
nc().use()
requires the function arg to be compatible with the props it receives. If you can't make it work out of the box, you may need to wrap it:Thanks for your help! Below a suggestion from my side to replace
const handler = nc().use(errorHandler)
withconst handler = router()
.Yeah my original code didn't work, that's a good way to put it. I just wouldn't call it router to avoid confusion, because it's just a handler, the router being managed inside Next core :).