mirror of
https://github.com/kou029w/_.git
synced 2025-01-31 06:18:07 +00:00
22 lines
450 B
JavaScript
22 lines
450 B
JavaScript
import { useLocation } from "preact-iso/router";
|
|
|
|
export default function Header() {
|
|
const { url } = useLocation();
|
|
return (
|
|
<header>
|
|
<nav>
|
|
<a href="/">Home</a>
|
|
<a href="/about">About</a>
|
|
<a href="/error">Error</a>
|
|
</nav>
|
|
<label>
|
|
URL:
|
|
<input
|
|
readonly
|
|
value={url}
|
|
ref={(c) => c && (c.size = c.value.length)}
|
|
/>
|
|
</label>
|
|
</header>
|
|
);
|
|
}
|