vue
vue copied to clipboard
Vue 2.7.14 mapState throws error with strict enabled
Version
2.7.14
Reproduction link
Steps to reproduce
If you enable strict
in tsconfig - compiler will throw "overload" errors, when you disable it - mapState works, but then methods will throw "Property 'xxx' does not exist on type 'Vue3Instance" error. As we tested "under the hood" strictFunctionTypes
causes these errors.
Versions:
node: v14.19.1
npm: 6.14.16
strict = false
(method)
strict = true
(mapState)
What is expected?
mapState would work without errors when strict is enabled.
What is actually happening?
It throws ts errors.