How to perform dom operations after query is updated - TanStack