Repository: remix-run/react-router
File: packages/react-router/lib/rsc/server.rsc.ts (TypeScript)

Code before:
            );
          }

          actionResult = result?.actionResult;
          formState = result?.formState;
          request = result?.revalidationRequest ?? request;

          if (ctx.redirect) {
            return generateRedirectResponse(
              ctx.redirect,
              actionResult,
              basename,
              isDataRequest,
              generateResponse,
              temporaryReferences,
              undefined,
            );
          }
        }

        if (skipRevalidation) {
          queryOptions.filterMatchesToLoad = () => false;
        }

        let staticContext = await query(request, queryOptions);

        if (isResponse(staticContext)) {
          return generateRedirectResponse(
            staticContext,
            actionResult,
            basename,
            isDataRequest,
            generateResponse,
            temporaryReferences,
            ctx.redirect?.headers,
          );
        }

        return generateStaticContextResponse(
          routes,
          basename,
          generateResponse,
          statusCode,
          routeIdsToLoad,
          isDataRequest,
          isSubmission,
          actionResult,
          formState,
          staticContext,
          temporaryReferences,
          skipRevalidation,

Review comment (refactor):
I don't think we need a reference to `queryOptions` here since if you don't pass a new `filterMatchesToLoad` it'll use the existing one?  I think we could revert lines 719-725 above and simplify this to:

```suggestion
        let staticContext = await query(
          request,
          skipRevalidation ? { filterMatchesToLoad = () => false } : undefined
        );
```

or this would be functionally equivalent too?

```tsx
        let staticContext = await query(request, {
          filterMatchesToLoad: skipRevalidation ? () => false : undefined
        });
```

Code after:

          skipRevalidation = result?.skipRevalidation ?? false;
          actionResult = result?.actionResult;
          formState = result?.formState;
          request = result?.revalidationRequest ?? request;

          if (ctx.redirect) {
            return generateRedirectResponse(
              ctx.redirect,
              actionResult,
              basename,
              isDataRequest,
              generateResponse,
              temporaryReferences,
              undefined,
            );
          }
        }

        let staticContext = await query(
          request,
          skipRevalidation
            ? {
                filterMatchesToLoad: () => false,
              }
            : undefined,
        );

        if (isResponse(staticContext)) {
          return generateRedirectResponse(
            staticContext,
            actionResult,
            basename,
            isDataRequest,
            generateResponse,
            temporaryReferences,
            ctx.redirect?.headers,
          );
        }

        return generateStaticContextResponse(
          routes,
          basename,
          generateResponse,
          statusCode,
          routeIdsToLoad,
          isDataRequest,
          isSubmission,
          actionResult,
          formState,
          staticContext,