Skip to content
Dashboard

Introducing: React Best Practices

Link to headingThe core idea: ordering

Link to headingWhat else is inside?

async function handleRequest(userId: string, skipProcessing: boolean) {
const userData = await fetchUserData(userId)
if (skipProcessing) {
// Returns immediately but still waited for userData
return { skipped: true }
}
// Only this branch uses userData
return processUserData(userData)
}

async function handleRequest(
userId: string,
skipProcessing: boolean
) {
if (skipProcessing) {
return { skipped: true }
}
const userData = await fetchUserData(userId)
return processUserData(userData)
}

Link to headingHow these practices were collected

Link to headingUsing react-best-practices in your coding agent

npx skills add vercel-labs/agent-skills