Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/pages/DeveloperLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import style from "../style/index.js";
import PageHeader from "../layout/PageHeader.jsx";
import { Outlet, useLocation } from "react-router-dom";
import { Helmet } from "react-helmet";
import { useEffect } from "react";

function ScrollToTop() {
const { pathname } = useLocation();

useEffect(() => {
window.scrollTo(0, 0);
}, [pathname]);

return null;
}

export default function DeveloperLayout() {
const { pathname } = useLocation();
Expand All @@ -18,6 +29,7 @@ export default function DeveloperLayout() {

return (
<main>
<ScrollToTop />
<Helmet>
<title>Developer tools | PolicyEngine</title>
</Helmet>
Expand Down
Loading