Skip to content

[Docs]: Unclear example "Add middleware to your routes"Β #14284

@florestankorp

Description

@florestankorp

Describe what's incorrect/missing in the documentation

Coming from Angular I was happy to see a familiar pattern in defining routes, but I can't seem to find this style of defining routes anywhere in the source code or documentation. I've looked everywhere for Component: but it doesn't seem to exist so I'm guessing it's a mistake?

https://reactrouter.com/how-to/middleware#2-add-middleware-to-your-routes

const routes = [
  {
    path: "/",
    unstable_middleware: [timingMiddleware], // πŸ‘ˆ
    Component: Root,
    children: [
      {
        path: "profile",
        unstable_middleware: [authMiddleware], // πŸ‘ˆ
        loader: profileLoader,
        Component: Profile,
      },
      {
        path: "login",
        Component: Login,
      },
    ],
  },
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions