There was an error while loading. Please reload this page.
1 parent 024cd7d commit 6b44d3dCopy full SHA for 6b44d3d
1 file changed
e2e/solid-start/deferred-hydration/src/routes/components.tsx
@@ -40,14 +40,12 @@ function InteractiveBox(props: { id: string; label: string }) {
40
41
function DelayedFallbackBox() {
42
if (typeof window !== 'undefined') {
43
- const [ready, setReady] = Solid.createSignal(false)
44
- window.setTimeout(() => setReady(true), 1000)
+ const child = Solid.createMemo(async () => {
+ await new Promise((resolve) => window.setTimeout(resolve, 1000))
45
+ return 'fallback child'
46
+ })
47
- return (
- <Solid.Show when={ready()}>
48
- <div data-testid="component-fallback-child">fallback child</div>
49
- </Solid.Show>
50
- )
+ return <div data-testid="component-fallback-child">{child()}</div>
51
}
52
53
return <div data-testid="component-fallback-child">fallback child</div>
0 commit comments