next(undefined) in navigation guard throws a TS error #1058
Labels
contribution welcome
The team would welcome a contribution from the community for this issue
good first issue
Good for newcomers
typescript
Problem related to TS typings
Version
4.0.10
Reproduction link
https://codesandbox.io/s/vue-router-nextundefined-example-xz4yo
Steps to reproduce
next(undefined)
What is expected?
next(undefined)
works the same way asnext()
since empty argument is treated asundefined
in JS.What is actually happening?
next(undefined)
throwsArgument of type 'undefined' is not assignable to parameter of type 'NavigationGuardNextCallback'
It seems that the
NavigationGuardNext
interface must be changed to either have anundefined
argument as a separate row or to make one of the options optional.The text was updated successfully, but these errors were encountered: