Skip to content

Commit

Permalink
Split out conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Dec 11, 2023
1 parent 4dcd6db commit b689d43
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/components/src/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export function ThemeProvider({
});
}, [activeThemes, selectedThemeKey, themes]);

return value == null ? null : (
<ThemeContext.Provider value={value}>
return (
<>
{activeThemes == null ? null : (
<>
{activeThemes.map(theme => (
Expand All @@ -110,8 +110,12 @@ export function ThemeProvider({
))}
</>
)}
<SpectrumThemeProvider>{children}</SpectrumThemeProvider>
</ThemeContext.Provider>
{value == null ? null : (
<ThemeContext.Provider value={value}>
<SpectrumThemeProvider>{children}</SpectrumThemeProvider>
</ThemeContext.Provider>
)}
</>
);
}

Expand Down

0 comments on commit b689d43

Please sign in to comment.