Skip to content

Rule · Lint

Page fetches its data in useEffect

lint/useeffect-fetchwarnvoid lintupdated

Why it matters

Fetching on mount in a client page renders an empty shell first, then waterfalls the request after JS downloads and hydrates: slower LCP, layout shift when data arrives, and crawlers see no content.

How to fix it

Fetch in the Server Component (async function Page()), pass data down as props, and stream slow parts with . For client-side interactivity use a cache (SWR/React Query) seeded with server data.

Example

tsx
export default async function Page() {
  const posts = await getPosts()
  return <PostList posts={posts} />
}

References

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.