import { useQuery } from "@tanstack/react-query"

const fetchData = () => {
  return {
    fake: 'data',
  }
}

const ParentComponent = () => {
  const { data, isLoading } = useQuery({
    queryFn: fetchData,
    queryKey: ['data'],
  })

  if (isLoading) {
    return <div>Loading...</div>
  }

  return (
    <div>
      <ChildComponent data={data} />
    </div>
  )
}
