Skip to content

Commit

Permalink
Fix editorPortalTarget default value for server-side rendering (#2245)
Browse files Browse the repository at this point in the history
* Fix editorPortalTarget default value for server-side rendering

* Don't get the body on each render
  • Loading branch information
nstepien authored Dec 3, 2020
1 parent 8cefebc commit 2579d2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ type DefaultColumnOptions<R, SR> = Pick<Column<R, SR>,
| 'sortable'
>;

const body = globalThis.document?.body;

export interface DataGridHandle {
scrollToColumn: (colIdx: number) => void;
scrollToRow: (rowIdx: number) => void;
Expand Down Expand Up @@ -199,7 +201,7 @@ function DataGrid<R, SR>({
enableFilterRow = false,
cellNavigationMode = 'NONE',
// Miscellaneous
editorPortalTarget = document.body,
editorPortalTarget = body,
className,
style,
rowClass,
Expand Down

0 comments on commit 2579d2b

Please sign in to comment.