refactor: flatten routes
This commit is contained in:
17
app/routes/blog.tsx
Normal file
17
app/routes/blog.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Link } from "@remix-run/react";
|
||||
import { Outlet } from "react-router-dom";
|
||||
import { LinkWrapper } from "~/components/LinkWrapper";
|
||||
import { useMatch } from "~/hooks/useMatch";
|
||||
|
||||
export default function () {
|
||||
const { handle } = useMatch();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<LinkWrapper>
|
||||
<Link to={handle.to}>{handle.text}</Link>
|
||||
</LinkWrapper>
|
||||
<Outlet />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user