-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug report] computedWithControl is triggering "Computed is still dirty after getter evaluation" warning #3794
Comments
cc @Doctor-wu |
@meteorlxy Hey, |
Submitted a PR for |
@Doctor-wu I see. Thanks for looking into that. It looks like a workaround in userland code. Is it possible to fix in vueuse side? If not, we'd better put a warning in the docs. |
A warning is a good point. But in fact, lots of function in vueuse have side effects, so it relies on user's judgment more often. |
I suggest not closing this issue too casually. it's weird to say:
Then why a name with I would suggest one of the 2 things which should really solve the issue:
As long as |
It just combines the usage of This function was added to
|
Again to clarify:
People will probably misuse it under 1, 2, 3, so it leads to 4 That's the problem I am talking, again, unless VueUse only use this one internally, otherwise I don't think I am convinced by any of the reasons above. |
I think mark this function is not a computed will be helpful, thanks for your suggestions! |
Yes, that's something I want to express, I do think that VueUse should do something to avoid people misuse them, for example, the It should be a historical problems, so hope you can open another issue to track it and help the community, while I am facing the problem in VuePress developing, I also notice a lot of similar noise upstream in Vue core about it after vue@3.4.19 raise a warning about it. Some of the issues are misuse of computed by users, while some of them are related to VueUse. I hope the second one can be nicely warned here. |
At least in my side, I believe returning a |
That's a hard one to check the full apis only by team, it's more feasible to rely on the power of community, PR are welcome for solve some historical problems like this.
For this part, if you find What ever, I will check |
I'm getting this warning while using "useStorage" form VueUse @Doctor-wu |
Did you use |
I'm using it in Pinia store inside getter |
Can you show me your code about this? |
Pinia store: `import { defineStore } from 'pinia'; export const UserStore = defineStore({
}); This is how I called it: (And this is where the warning shows from)
|
Is there any warning if you just returned a static value like getters: {
isLoggedIn: () => true,
} |
No, the warning disappear when I return anything other than VueUse function like as a warkaround I'm using |
You can extract the const isLoggedInRef = useStorage('isLoggedIn')
...
getters: {
isLoggedIn: () => isLoggedInRef.value
} |
BTW, it's not suggested to directly reply under a closed issue, you can create a new one next time. |
- update deps to fix vueuse/vueuse#3794 via vueuse/vueuse#3815
Describe the bug
Related issue: vuejs/core#10341
computedWithControl
will trigger the warning in vue 3.4.19:Reproduction
https://stackblitz.com/edit/vitejs-vite-bvw5gp?file=src%2FApp.vue
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: