feat: bring back <Head> component (#3249)
This PR brings back the `<Head>` component from Fresh 1.x . The implementation is much cleaner than back then and also works client-side now too.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import { Head } from "fresh/runtime";
|
||||
|
||||
export function StyleIdIsland() {
|
||||
const [ready, setReady] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setReady(true);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div class={ready ? "ready" : ""}>
|
||||
<Head>
|
||||
<style id="style-id">ok</style>
|
||||
</Head>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user