Skip to content

Commit 744b9e5

Browse files
committed
Lazy load css for legacy themes
1 parent e604f0c commit 744b9e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/components/AgGrid.react.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ function DashAgGrid(props) {
103103

104104
const shouldLoadLegacyCSS = useMemo(() => {
105105
// Only load legacy CSS if theme is 'legacy' or unset
106+
const dashGridOptions = props.dashGridOptions || {};
106107
return (
107-
!('theme' in props.dashGridOptions) ||
108-
props.dashGridOptions.theme === 'legacy'
108+
!('theme' in dashGridOptions) ||
109+
dashGridOptions.theme === 'legacy'
109110
);
110-
}, [props.dashGridOptions.theme]);
111+
}, [props.dashGridOptions]);
111112

112113
const LegacyThemeLoader = useMemo(() => {
113114
if (

0 commit comments

Comments
 (0)