Skip to content

Commit 6b44d3d

Browse files
committed
fix DelayedFallbackBox test
1 parent 024cd7d commit 6b44d3d

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

e2e/solid-start/deferred-hydration/src/routes/components.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ function InteractiveBox(props: { id: string; label: string }) {
4040

4141
function DelayedFallbackBox() {
4242
if (typeof window !== 'undefined') {
43-
const [ready, setReady] = Solid.createSignal(false)
44-
window.setTimeout(() => setReady(true), 1000)
43+
const child = Solid.createMemo(async () => {
44+
await new Promise((resolve) => window.setTimeout(resolve, 1000))
45+
return 'fallback child'
46+
})
4547

46-
return (
47-
<Solid.Show when={ready()}>
48-
<div data-testid="component-fallback-child">fallback child</div>
49-
</Solid.Show>
50-
)
48+
return <div data-testid="component-fallback-child">{child()}</div>
5149
}
5250

5351
return <div data-testid="component-fallback-child">fallback child</div>

0 commit comments

Comments
 (0)