FunctionType of the root element
Forest app props
The decorated DOM element.
const { routerStore } = createRouter();
const app = createForest((body) => addChild({ routerStore }, ({ routerStore }) => {
if (routerStore?.path === "/") {
return import("./pages/home");
}
if (routerStore?.path === "/about") {
return import("./pages/about");
}
if (routerStore?.path === "/404") {
return import("./pages/404");
}
return import("./pages/404");
})(body));
createForest