Fork me on GitHub
#reitit
<
2021-10-13
>
Michaël Salihi17:10:05

Using reitit-frontend, I wonder to know the best approch to using routes to generate a menu + submenu (Reagent app). The API is simple https://ant.design/components/menu/#API

<Menu>
  <Menu.Item>Menu</Menu.Item>
  <SubMenu title="SubMenu">
    <Menu.Item>SubMenuItem</Menu.Item>
  </SubMenu>
</Menu>
Is the nested routers the path to take? https://github.com/metosin/reitit/blob/master/doc/advanced/composing_routers.md#nesting-routers

Michaël Salihi08:10:15

@zengxh Yes they change URL and it works great for one level routes that generate simple flat menu. My question was more about nested routes to generate sub-menus like in this React with react-router example: https://github.com/pjchender/react-router-breadcrumb/blob/master/src/routes.js#L23-L42

Apple19:10:02

Do these components change URL at all? I thought rfe deals with URL only.

Apple19:10:21

Essentially based on browser history API

worlds-endless22:10:54

My thoughts too, Apple.