react-use-client-boundary

Identify optimal placement of the 'use client' directive in React and Next.js apps.

280|36|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/flpbalada/my-opencode-config --skill react-use-client-boundary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-use-client-boundary
Source: https://github.com/flpbalada/my-opencode-config/tree/main/skills/react-use-client-boundary
Command: npx skills add https://github.com/flpbalada/my-opencode-config --skill react-use-client-boundary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill clarifies when and how to apply the use client directive to manage server and client boundaries in React/Next.js, preventing accidental client leakage and confusing component hierarchies.

Core Features & Use Cases

  • Boundary reasoning: determines whether a component should live in a client boundary based on interactivity needs and import relationships.
  • Practical guidance: provides mental models, rules of thumb, and patterns for client/server separation in real apps.
  • Use Case: When a page contains interactive widgets, place the client boundary at the component that requires state or browser APIs, and keep child components pure.

Quick Start

Ask the AI to outline how to structure a page with a server component and a client child to ensure proper use of the directive.

Frequently Asked Questions about react-use-client-boundary

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

FAQPage Schema
When do I need the 'use client' directive in a Next.js app?

You need the 'use client' directive in a Next.js app when a component requires interactivity, state, or browser APIs. Place the client boundary at the component requiring these features, keeping child components pure to prevent accidental client leakage.

How do I structure a page with mixed server and client boundaries in React?

To structure a page with mixed server and client boundaries, place the 'use client' directive at the component requiring interactivity or state. This boundary isolates client logic while keeping parent and child components server-rendered and pure.

Why does adding 'use client' to a parent component affect its imports?

Adding 'use client' to a parent component affects its imports because when a client boundary is introduced, all imported child components become client components. This rule prevents confusing component hierarchies and accidental client leakage.

Should I avoid adding 'use client' to child components unnecessarily?

Avoid adding 'use client' to child components unnecessarily because once a client boundary is introduced, all imports become client components. Keep child components pure and only isolate the specific component requiring state or browser APIs.

What is the best way to isolate interactive widgets in React server components?

The best way to isolate interactive widgets in React server components is to wrap only the interactive widget in a client boundary. Place the 'use client' directive on the widget component to separate it from server-rendered content.

Can I mix server-rendered content with client-only logic in Next.js?

Yes, you can mix server-rendered content with client-only logic by placing a client boundary at the component that requires state or browser APIs. This separates interactive widgets and forms from the server component hierarchy.