Skip to content

Commit c233db1

Browse files
committed
feat: extract theme provider
1 parent a120650 commit c233db1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

packages/devtools-utils/src/solid/class-mount-impl.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,17 @@ import type { JSX } from 'solid-js'
77
export function __mountComponent(
88
el: HTMLElement,
99
theme: 'light' | 'dark',
10-
importFn: () => Promise<{ default: () => JSX.Element }>,
10+
importFn: () => Promise<{
11+
default: (props: { theme: 'light' | 'dark' }) => JSX.Element
12+
}>,
1113
): () => void {
1214
const Component = lazy(importFn)
13-
const ThemeProvider = lazy(() =>
14-
import('@tanstack/devtools-ui').then((m) => ({
15-
default: m.ThemeContextProvider,
16-
})),
17-
)
1815

1916
return render(
2017
() => (
2118
<Portal mount={el}>
2219
<div style={{ height: '100%' }}>
23-
<ThemeProvider theme={theme}>
24-
<Component />
25-
</ThemeProvider>
20+
<Component theme={theme} />
2621
</div>
2722
</Portal>
2823
),

0 commit comments

Comments
 (0)