query param reader

This commit is contained in:
2026-04-11 14:37:31 -05:00
parent 144a81f8a4
commit 0513ff5585
3 changed files with 34 additions and 6 deletions

View File

@@ -13,8 +13,10 @@ export const ROUTES: Routes = [
function Route(props: PropsWithChildren & {route: Route}) {
const {route: [path], children} = props;
const router = useRouter();
// remove search params
const [cleanPath] = /\/?\w*[^?]/.exec(router.current) ?? [path];
return <>{router.current === path && children}</>
return <>{cleanPath === path && children}</>
}