Closed
Description
I really dont understand why getCurrentInstance
is descripted as anti pattern in application code.
Here is the documentation part that i mean:
docs/src/api/composition-api.md
Lines 216 to 223 in 10ed910
I am working on a large vue 2.6 codebase and in my optinion using getCurrentInstance
can be a great improvement for reusable hooks, which need SetupContext
. Currently we are passing the context, but in my option it makes refactoring hard and i think it would be a great improvment to use getCurrentInstance
in some cases.
Whats the reason its descripted as anti pattern?
SetupContext
Type doens't get extended?- Is it a perfomance problem?
For example a nested hook needs some vuetify variable of SetupContext
or use of a Router without Provide / Inject API
Metadata
Metadata
Assignees
Labels
No labels