react-router 6.28.3-pre-v6.0 → 6.28.3-pre-v6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # `react-router`
2
2
 
3
+ ## 6.28.3-pre-v6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Limit matchRoutes optimization to client side routers ([#12881](https://github.com/remix-run/react-router/pull/12881))
8
+
3
9
  ## 6.28.3-pre-v6.0
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v6.28.3-pre-v6.0
2
+ * React Router v6.28.3-pre-v6.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -327,7 +327,8 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
327
327
  // router loaded. We can help them understand how to avoid that.
328
328
  "useRoutes() may be used only in the context of a <Router> component.") : UNSAFE_invariant(false) : void 0;
329
329
  let {
330
- navigator
330
+ navigator,
331
+ static: isStatic
331
332
  } = React.useContext(NavigationContext);
332
333
  let {
333
334
  matches: parentMatches
@@ -392,7 +393,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
392
393
  let segments = pathname.replace(/^\//, "").split("/");
393
394
  remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
394
395
  }
395
- let matches = dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, {
396
+ let matches = !isStatic && dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, {
396
397
  pathname: remainingPathname
397
398
  });
398
399
  if (process.env.NODE_ENV !== "production") {