Skip to content

Commit 4a9a664

Browse files
author
Fergus Bisset
committed
fix(behaviours): preserve 'use client' directive in React behaviours build
- Add banner to Vite config to preserve 'use client' directive - Update examples/nextjs BehavioursLoader with 'use client' directive - Add comprehensive BEHAVIOURS_ARCHITECTURE.md documentation - Explains SSR vs Client Component architecture - Clarifies that BehavioursLoader is ALWAYS a client component - It enhances SSR HTML after hydration, not during SSR Fixes 'createContext is not a function' error in Next.js App Router The directive was being stripped by Vite during build process
1 parent 9ab956e commit 4a9a664

File tree

6 files changed

+820
-4
lines changed

6 files changed

+820
-4
lines changed

config/vite.behaviours.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export default defineConfig({
1919
external: ['react', 'react/jsx-runtime'],
2020
output: {
2121
preserveModules: false,
22+
// Preserve "use client" directive for Next.js
23+
banner: '"use client";',
2224
},
2325
},
2426
},

0 commit comments

Comments
 (0)