void-client-vs-server-component

Decides server versus client placement for React 19 components and positions 'use client' boundaries.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-client-vs-server-component-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-client-vs-server-component
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/cli/core-assets/packs/pack-react/skills/void-client-vs-server-component
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-client-vs-server-component-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React 19 and Next.js App Router projects often ship excessive JavaScript to the browser because developers mark components with 'use client' by default. This Skill enforces a server-first discipline so only components that genuinely need browser APIs become Client Components. ## Core Features & Use Cases - Server-by-default rule: Keeps components as Server Components unless they use state hooks, effects, browser APIs, or event handlers. - Boundary placement guidance: Pushes 'use client' as far down the tree as possible, isolating interactive islands instead of converting entire pages. - State ownership table: Maps concerns like URL params, transient UI state, and optimistic updates to the correct server or client location. - Use Case: When building a Next.js dashboard page with a filter input and a data list, this Skill guides you to keep the list as a Server Component, isolate the filter as a small Client Component, and pass filter state through URL search params. ## Quick Start Ask the agent to review your new React component and decide whether it should be a Server or Client Component with the 'use client' boundary placed correctly.

Frequently Asked Questions about void-client-vs-server-component

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide between Server and Client Components in Next.js?

Default to a Server Component and add 'use client' only when the component uses state hooks like useState, effects like useEffect, browser APIs such as window or localStorage, or component-level event handlers. If none of these apply, leave it on the server.

Where should I place the 'use client' directive in a React app?

Place 'use client' as far down the component tree as possible, isolating only the interactive leaf components. Marking a page or layout as client converts its entire subtree, shipping unnecessary JavaScript to the browser.

Can a Server Component be a child of a Client Component?

Yes, a Client Component can receive Server Components through its children prop, enabling client-wraps-server composition. The inverse, importing a Client Component's parent as server inside client code, is not allowed.

Should forms in Next.js use Client Components or Server Actions?

Use Server Actions with 'use server' called from a Server Component form so the HTML is server-rendered with progressive enhancement. Only wrap individual inputs in Client Components when you need controlled state for validation feedback.

Why is my Next.js page shipping too much JavaScript?

Excessive JS usually means too many components are marked 'use client', often at the page or layout level. Audit the Network tab for JS payload size and push client boundaries down to only the components using state, effects, or browser APIs.