Closed haikyuu closed 4 years ago
Glad you like the library!
When you want to pass through all unmatched routes from a mount
, then instead of using /
, you'll want to use a *
wildcard:
export default compose(
mount({
"/login": route({
title: "Login",
view: <Login />,
}),
"*": compose(
withView((request) => (
// This is the first view -- it renders the second within a
// `<Layout>` component.
<Layout request={request} mountpath={request.mountpath || "/"}>
<View />
</Layout>
)),
mount({
"/home": route({
title: "Home",
getData: () => api.get("cases").json(),
view: <Home />,
}),
})
),
})
);
Hope this helps!
Works like a charm. Thanks
Hi, thanks for this beautiful library.
I'd like to implement a basic layout in my app:
I get
/home
not found error. Can you help me fix this issue?