Skip to content

[Docs]: "Server vs Client Middleware" section #14396

@SeanHolt

Description

@SeanHolt

Describe what's incorrect/missing in the documentation

On this page: https://reactrouter.com/how-to/middleware#3-export-middleware-from-your-routes
Under: "Server vs Client Middleware"

The code example uses function arguments that do not exist.

async function serverMiddleware({ request }, next) {
  console.log(request.method, request.url);
  let response = await next();
  console.log(response.status, request.method, request.url);
  return response;
}

"response" does not exist.

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