Sign in
Log inSign up

How do you handle client app Sub-Routing?

Nicos Tsourektsidis's photo
Nicos Tsourektsidis
·Jan 4, 2017

Hi guys, I have a question regarding routing in a react client CMS app that I'm working on. We use react-router but this question has to do with routing in general.

While the user visits a page of a website, we have a drawer/sidebar which allows the user to manage basic entities of the website like pages, media, users etc. Currently we are using redux actions to show/hide elements in the page. We found this a little bit confusing and not very practical. We want to change that and to move this navigation functionality to the router. We use react-router of course.

We are thinking to add some additional routes to the app in order to keep the currently visible page in the url. For example consider that the user opens the app and visits a page: #app/page/someflag

Now consider that the user wants to manage users: #app/page/someflag/manage/users

In this case a sidebar/drawer appears with a list of the users and when we click to edit one of them we can have a route like: #app/page/someflag/manage/users/edit/10

Do you thing these routes are ok? Any suggestions?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct