Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Documents React 19 patterns for Server Components, Actions, Suspense, hooks, and component composition.
91% 96%+4 ptsof test cases passed
Passed 22 of 23 test cases with the skill, and 21 of 23 without it.
3 of 3 safety checks passed
Not used yet
use() reads values from Promises and Context directly in render. Unlike other hooks, it can be called inside conditionals and loops.
import { use } from 'react';
function UserProfile({ userPromise }: { userPromise: Promise<User> }) {
const user = use(userPromise);
return <h1>{user.name}</h1>;
}
function ThemeButton() {
const theme = use(ThemeContext);
return <button style={{ background: theme.primary }}>Click</button>;
}
Wrap components that use use() with a Promise in a <Suspense> boundary.
// app/users/page.tsx - Server Component (default, no directive needed)
import { UserList } from './UserList';
export default async function UsersPage() {
const users = await fetch('https://api.example.com/users', {
next: { revalidate: 60 },
}).then(r => r.json());
return <UserList users={users} />;
}
// app/users/UserList.tsx - Still a Server Component
export function UserList({ users }: { users: User[] }) {
return (
<ul>
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.