Routing
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
Hey,
I know this is more of a React Question and nothing NextJS specific but I need this question to be answered! D:
Let's say I have built an application where tasks for different Projects can be managed. The Sidebar items are "Home" and "Projects" with its sub Projects. The user is able to give each Project a name and like a tag. Depending on which Project the User clicks, a different Task-App should appear, container all the tasks for that specific project. Moreover, if the User clicks on Home, a different Screen should appear. I'm pretty new to React and yet I've mostly handled that with state and conditionally rendering. Having an array of projects with subobjects for the tasks and if the user clicks on a certain page, it contionally renders for example tasks[1], and the specific task would be tasks[1][2] or something. Is that the correct way to approach this?
I know this is more of a React Question and nothing NextJS specific but I need this question to be answered! D:
Let's say I have built an application where tasks for different Projects can be managed. The Sidebar items are "Home" and "Projects" with its sub Projects. The user is able to give each Project a name and like a tag. Depending on which Project the User clicks, a different Task-App should appear, container all the tasks for that specific project. Moreover, if the User clicks on Home, a different Screen should appear. I'm pretty new to React and yet I've mostly handled that with state and conditionally rendering. Having an array of projects with subobjects for the tasks and if the user clicks on a certain page, it contionally renders for example tasks[1], and the specific task would be tasks[1][2] or something. Is that the correct way to approach this?
8 Replies
It depends on scope. You could do it that way but the way your describing it is more akin to 'tabs' which wouldnt be exactly routing.
Barbary LionOP
"Tabs" is an interesting term. I'll look that up.
What about React Routing or Next Routing? When is this useful?
So it really depends on what your going for....
I have an application where im selecting users from a navigation bar on the left, when I select the user a different view opens up on the right depending on the user, usertype, user status. That is using tabs. I also have a navigation bar that pulls out and those are routing to different pages entirely.
Barbary LionOP
okay so you are basically handling it similar to me with the big arrays of arrays and objects
Yes I am, but only because it is necessary. Its an internal application our support uses to get details on a user, sometimes they need to quickly switch back and fourth, theres also some compare functionality where you can select two people from the 'cache' of data and compare and get a diff.
Barbary LionOP
how does your folder structure typically look like? what do you use for state management?