const [tag] = createResource(() => params.slug, findTagBySlug);
return (
<>
<Show when={tag.state === "ready" && !tag()}>
<HttpStatusCode code={404}/>
<ErrorLayout statusCode={404}/>
</Show>
<Show when={tag()}>
{tag => (
// render tag page
)}
</Show>
</>
);
const [tag] = createResource(() => params.slug, findTagBySlug);
return (
<>
<Show when={tag.state === "ready" && !tag()}>
<HttpStatusCode code={404}/>
<ErrorLayout statusCode={404}/>
</Show>
<Show when={tag()}>
{tag => (
// render tag page
)}
</Show>
</>
);