Zanoryt
Zanoryt
Explore posts from servers
SSolidJS
Created by Zanoryt on 8/12/2023 in #support
Now using createResource(), the content never loads.
const getReports = async () => {
return (await fetch('/api/reports')).json();
};

export default function Home() {
const [reports, { refetch }] = createResource(getReports);
...snip...

<Show when={!reports.loading} fallback={<tr><td>Loading...</td></tr>}>
<For each={reports()}>{item => (
<tr>
...snip...
</tr>
)}</For>
</Show>
...snip...
};
const getReports = async () => {
return (await fetch('/api/reports')).json();
};

export default function Home() {
const [reports, { refetch }] = createResource(getReports);
...snip...

<Show when={!reports.loading} fallback={<tr><td>Loading...</td></tr>}>
<For each={reports()}>{item => (
<tr>
...snip...
</tr>
)}</For>
</Show>
...snip...
};
All I ever see is Loading... in the rendering. I'm using SSR with Cloudflare Pages.
11 replies
SSolidJS
Created by Zanoryt on 7/22/2023 in #support
What's the best way to create multiple layouts that only some routes use?
I need to have multiple layouts. I'd like some pages to use different layouts, rather than a single universal layout.
2 replies
SSolidJS
Created by Zanoryt on 7/22/2023 in #support
How can I access a store from the parent context from inside of a nested context?
I am trying to access the WebsocketContext from inside of the DataStreamContext, in order to send out a websocket message when a DataStreamContext function is called. I can't seem to figure out the right way to do this. Provider structure:
<Html lang="en">
<Head>
<Title>Airframes</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<WebsocketProvider>
<DataStreamProvider>
<Routes>
<FileRoutes />
</Routes>
</DataStreamProvider>
</WebsocketProvider>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
<Html lang="en">
<Head>
<Title>Airframes</Title>
<Meta charset="utf-8" />
<Meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<Body>
<Suspense>
<ErrorBoundary>
<WebsocketProvider>
<DataStreamProvider>
<Routes>
<FileRoutes />
</Routes>
</DataStreamProvider>
</WebsocketProvider>
</ErrorBoundary>
</Suspense>
<Scripts />
</Body>
</Html>
38 replies