react-server675fbba4
react-serverfilestestfixtureshttp-rewrite.jsx
test/fixtures/http-rewrite.jsxjsx324 Bb03d5cc0
import { rewrite, useUrl } from "@lazarv/react-server";

export function init$() {
  return async () => {
    const { pathname } = useUrl();
    if (pathname !== "/rewrite") {
      rewrite("/rewrite");
    }
  };
}

export default function HttpRewritePage() {
  const { pathname } = useUrl();
  return <p>{pathname}</p>;
}