MathiasM
Convex Community2y ago
10 replies
Mathias

How to prevent re-rendering using useMutation?

I'm using a Sheet component from Shadcn/ui in my Next.js project.

Currently, the Sheet "closes" automatically whenever there are changes to statuses, assignees, etc. This behavior appears to be linked to the use of useMutation because if I disable the mutation, the Sheet remains open during these changes. I need the Sheet to stay open even while data changes via mutations.

It appears that the issue is present either using useState from React or when using Zustand.

Is there a method to prevent the Sheet from auto-closing when the mutation is executed?
Was this page helpful?