Closed petterik closed 6 years ago
Routing works by having components declare :lajter/routing in the component:
:lajter/routing
{:lajter/id :lajter.web.main/Router :lajter/routing {:navbar {:route.navbar/a NavbarA :route.navbar/b NavbarB} :body {:route.body/a ComponentA :route.body/b ComponentB}} ... }
The component can then call render-route like so:
render-route
(dom/div nil (la/render-route this :navbar) (la/render-route this :body))
Which renders the component for the given route.
The route is selected by a :route-fn that's passed to the reconciler.
:route-fn
Routing works by having components declare
:lajter/routing
in the component:The component can then call
render-route
like so:Which renders the component for the given route.
The route is selected by a
:route-fn
that's passed to the reconciler.