feat(ui): use keyed show to re-render Machine route when route changes

This commit is contained in:
Brian McGee
2025-07-25 11:08:04 +01:00
parent ae20230a57
commit 2c3b0f3771

View File

@@ -1,6 +1,7 @@
import { RouteSectionProps, useNavigate } from "@solidjs/router";
import { SidebarPane } from "@/src/components/Sidebar/SidebarPane";
import { navigateToClan, useClanURI, useMachineName } from "@/src/hooks/clan";
import { Show } from "solid-js";
export const Machine = (props: RouteSectionProps) => {
const navigate = useNavigate();
@@ -11,9 +12,13 @@ export const Machine = (props: RouteSectionProps) => {
navigateToClan(navigate, clanURI);
};
const machineName = useMachineName();
return (
<Show when={useMachineName()} keyed>
<SidebarPane title={useMachineName()} onClose={onClose}>
<h1>Hello world</h1>
</SidebarPane>
</Show>
);
};