Is this best practice or what is the best way to achieve this? - TanStack