Skip to content

noNextAsyncClientComponent

Prevent client components from being async functions.

This rule prevents the use of async functions for client components in Next.js applications. Client components marked with “use client” directive should not be async as this can cause hydration mismatches, break component rendering lifecycle, and lead to unexpected behavior with React’s concurrent features.

"use client";
export default async function MyComponent() {
return <div>Hello</div>;
}
code-block.jsx:3:16 lint/nursery/noNextAsyncClientComponent ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The component MyComponent is an async client component, which is not allowed.

1 │ “use client”;
2 │
> 3 │ export default async function MyComponent() {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4 │ return <div>Hello</div>;
> 5 │ }
^
6 │

Client components with “use client” directive should not be async functions as this can cause hydration mismatches and break React’s rendering lifecycle.

Consider using useEffect for async operations inside the component, or remove the “use client” directive if this should be a server component.

"use client";
export default function MyComponent() {
return <div>Hello</div>;
}
// No "use client" directive - server component can be async
export default async function ServerComponent() {
const data = await fetch('/api/data');
return <div>{data}</div>;
}
biome.json
{
"linter": {
"rules": {
"nursery": {
"noNextAsyncClientComponent": "error"
}
}
}
}