esbuild plugin for compiling React libraries compatible with React 18 server and client components, used with Next.js, Remix, etc. Current stable version 1.0.8. Deprecated in favor of esbuild-plugin-react18. Automatically adds 'use client' directive to client components during esbuild bundling. Key differentiator: enables libraries to ship both server and client components using esbuild/tsup without manual directive insertion. Lightweight alternative to full-fledged RSC tooling.
npm install esbuild-react18-useclientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin with tsup and directly with esbuild. The plugin automatically adds 'use client' directives to client components.
Replace with esbuild-plugin-react18: npm install esbuild-plugin-react18 and update import.
Ensure you call the plugin: [reactUseClient()] instead of [reactUseClient].
Use compatible bundler. For webpack/rollup, consider alternatives like @rollup/plugin-babel with directives.
Run npm install --save-dev esbuild-react18-useclient
Use import reactUseClient from 'esbuild-react18-useclient' (ESM) or const reactUseClient = require('esbuild-react18-useclient').default (CommonJS).Add 'use client'; at the top of your client component files.
No dependency data recorded yet.