fix: error on duplicate partial name (#1958)

This commit is contained in:
Marvin Hagemeister
2023-10-18 20:04:37 +02:00
committed by GitHub
parent 4c59f9df65
commit 7896005329
5 changed files with 199 additions and 141 deletions
@@ -0,0 +1,29 @@
import { Partial } from "$fresh/runtime.ts";
import { PageProps } from "$fresh/server.ts";
export default function SlotDemo(props: PageProps) {
const update = props.url.searchParams.has("swap");
return (
<div>
<Partial name="slot-1">
<h2>foo</h2>
<p>some text</p>
</Partial>
{update && (
<Partial name="slot-1">
<p>foo</p>
</Partial>
)}
<p>
<a
class="swap-link"
href="/duplicate_name"
f-partial="/duplicate_name?swap=foo"
>
swap
</a>
</p>
</div>
);
}