vorph
vorph
SSolidJS
Created by vorph on 5/27/2024 in #support
Suspense overlay
Hi, I'm currently working on an application where we're performing multiple requests via resources in nested components and using Suspense as a catch all to show a loading indicator would make a lot of sense. The issue is that we do want to show the children of Suspense and the indicator at the same time. I skimmed through the Suspense source and it doesn't seem possible to hook into the existing system since SuspenseContext/getSuspenseContext is not exported to create a separate component. Is it feasible to do this with the current state of Suspense? Something like an overlay prop on Suspense would be ideal eg.
<Suspense fallback={<div>Loading...</div>} overlay={true}>
<AsyncFooBar />
</Suspense>
<Suspense fallback={<div>Loading...</div>} overlay={true}>
<AsyncFooBar />
</Suspense>
8 replies