Skip to content

Commit

Permalink
Removed null checks from providers
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Dec 13, 2023
1 parent f793916 commit ae25ea6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions packages/chart/src/ChartThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ export function ChartThemeProvider({
}: ChartThemeProviderProps): JSX.Element {
const { activeThemes } = useTheme();

const chartTheme = useMemo(
() => (activeThemes == null ? null : defaultChartTheme()),
[activeThemes]
);
const chartTheme = useMemo(defaultChartTheme, [activeThemes]);

return (
<ChartThemeContext.Provider value={chartTheme}>
Expand Down
5 changes: 1 addition & 4 deletions packages/iris-grid/src/IrisGridThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ export function IrisGridThemeProvider({
}: IrisGridThemeProviderProps): JSX.Element {
const { activeThemes } = useTheme();

const gridTheme = useMemo(
() => (activeThemes == null ? null : createDefaultIrisGridTheme()),
[activeThemes]
);
const gridTheme = useMemo(createDefaultIrisGridTheme, [activeThemes]);

return (
<IrisGridThemeContext.Provider value={gridTheme}>
Expand Down

0 comments on commit ae25ea6

Please sign in to comment.