Skip to content

Allow partial declaration of routes #193

Closed
@abergs

Description

@abergs

Very useful for when you want to split your routes into different sections:

var ContactsRoutes = require("contactRoutes");
...
<Routes>
    <Route path="/" handler={home}>
        {ContactsRoutes}        
        {BookingRoutes}
        {ItemsRoutes}
    </Route>    
  </Routes>

Currently, the above solution works, but only as long as you only have one <Route> with nested child routes within your required Routesmodules (e.g. ContactsRoutes).

It doesn't work if I have multiple routes inside of ContactsRoutes, which are not nested, because of JSX not allowing multiple adjacent components.

My suggestion is to reuse <Routes> as a container (with no additional behavior).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions