Skip to content

Commit 773ef19

Browse files
Copilothotlong
andcommitted
Add Next.js setup instructions to plugin-aggrid README
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9c93505 commit 773ef19

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/plugin-aggrid/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ pnpm add @object-ui/plugin-aggrid ag-grid-community ag-grid-react
3131

3232
Note: `ag-grid-community` and `ag-grid-react` are peer dependencies and must be installed separately.
3333

34+
### Next.js App Router Setup
35+
36+
If you're using Next.js with the App Router and dynamic imports, you may need to import AG Grid CSS in your root layout to ensure styles load correctly:
37+
38+
```typescript
39+
// app/layout.tsx
40+
import 'ag-grid-community/styles/ag-grid.css';
41+
import 'ag-grid-community/styles/ag-theme-quartz.css';
42+
import 'ag-grid-community/styles/ag-theme-alpine.css';
43+
import 'ag-grid-community/styles/ag-theme-balham.css';
44+
import 'ag-grid-community/styles/ag-theme-material.css';
45+
```
46+
47+
This is necessary when the plugin is loaded dynamically (e.g., via `React.lazy()` or dynamic imports in client components), as Next.js may not properly process CSS imports from dynamically loaded modules.
48+
3449
## Usage
3550

3651
### Automatic Registration (Side-Effect Import)

0 commit comments

Comments
 (0)