How to avoid useEffect for render twice? - TanStack