question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nested route does not load component

See original GitHub issue

Hello, my nested route does not load the component. here is my code

const routes = [ { name: 'locations', layout: AdminLayout, component: LocationsPage, onlyIf: { guard: store.isLogged, redirect: '/login' }, nestedRoutes: [ { name: '/:id', component: LocationPage } ] }],

the LocationPage does not load when i go to locations/1. The LocationsPage stays loaded.

any idea why?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dtzxportercommented, Mar 29, 2021

finder.js lines 70-71, you can fix the logic there.

0reactions
Marcel2508commented, Jun 18, 2021

Yeah, this seems to be not yet solved… This example is not working properly (/customer -> Customer component and /customer/123/edit -> Customer component)…

  {
        name:"customer",
        component: Customer,
        layout: AppLayout,
        onlyIf: {guard: getPermCheck("customer"), redirect:"/noperm"},
        nestedRoutes:[
            {
                name:"new", //New formular
                component: WIP,
                onlyIf:{onlyIf: getPermCheck("customer_new"),redirect:"/customer"},
                layout: AppLayout,
            },
            {
                name:":id/edit",
                component: CustomerEdit,
                onlyIf:{onlyIf: getPermCheck("customer_edit"),redirect:"/customer2"},
                layout: AppLayout,
            }
        ]
    }

Any Idea about this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

why the component doesn't load in nested routing (react)
1 Answer 1 ... There are few more issues in your code: ... const ShowIt = () => <div>Hello world</div>;.
Read more >
React Router and nested routes - Kevin Farrugia
In my own words, a nested route is a region within a page layout that responds to route changes. For example, in a...
Read more >
react router v6 nested routes not working - You.com
Nested routing is not working in React Router v6 | QueryThreads ... The default behavior of React Router fails to render multiple child...
Read more >
Nested routes in / don't get rendered #8685 - GitHub
Hi I need help migrating to v6, basically our top level component App.jsx uses withAuthenticator hoc which provides auth context to all of...
Read more >
How to Use Nested Routes in React Router 6
Nested routes enables you to have multiple components render on the same page with route parity. This is useful for app experiences where ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found