#
PublicRoutes
A placeholder indicating where in the routing tree should the public routes be rendered. The PublicRoutes
placeholder concept is similar to React Router's outlet, it's a pipeline to inject routes at a predetermined location.
A public route is a route with a
"public"
visibility that is not hoisted or nested with either a parentPath or parentId option.
#
Reference
<PublicRoutes />
#
Properties
None
#
Usage
The route defining the PublicRoutes
placeholder must be hoisted; otherwise, there will be an infinite loop as the PublicRoutes
placeholder will render within itself.
shell/src/register.tsx
import { PublicRoutes } from "@squide/firefly";
import { RootLayout } from "./RootLayout.tsx";
runtime.registerRoute({
// Pathless route to declare a root layout.
element: <RootLayout />,
children: [
PublicRoutes
]
}, {
hoist: true
});