As outlined in https://github.com/denoland/fresh/issues/2254 it was possible to overwrite the script tag that is used by Fresh to pass island props from the server to the client. This could be done by injecting raw HTML via `dangerouslySetInnerHTML` and simply using the same id that Fresh was using. With this PR we generate a unique id per render that cannot be guessed anymore. It's composed of `__FRSH_STATE_<uuid>`
12 lines
316 B
TypeScript
12 lines
316 B
TypeScript
import { Partial } from "$fresh/runtime.ts";
|
|
import DangerousIsland from "../../islands/DangerousIsland.tsx";
|
|
|
|
export default function Res() {
|
|
return (
|
|
<Partial name="content">
|
|
<DangerousIsland raw={`<h1 id="__FRSH_STATE">{.invalid.json}</h1>`} />
|
|
<p class="done">partial</p>
|
|
</Partial>
|
|
);
|
|
}
|