@remix-run/router 1.6.1 → 1.6.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.6.1
2
+ * @remix-run/router v1.6.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1938,12 +1938,14 @@
1938
1938
  }
1939
1939
  });
1940
1940
  return;
1941
- } // Short circuit if it's only a hash change and not a mutation submission
1941
+ } // Short circuit if it's only a hash change and not a mutation submission.
1942
+ // Ignore on initial page loads because since the initial load will always
1943
+ // be "same hash".
1942
1944
  // For example, on /page#hash and submit a <Form method="post"> which will
1943
1945
  // default to a navigation to /page
1944
1946
 
1945
1947
 
1946
- if (isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1948
+ if (state.initialized && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
1947
1949
  completeNavigation(location, {
1948
1950
  matches
1949
1951
  });
@@ -2955,7 +2957,8 @@
2955
2957
  }
2956
2958
 
2957
2959
  function _internalSetRoutes(newRoutes) {
2958
- inFlightDataRoutes = newRoutes;
2960
+ manifest = {};
2961
+ inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);
2959
2962
  }
2960
2963
 
2961
2964
  router = {
@@ -4210,15 +4213,17 @@
4210
4213
  }
4211
4214
 
4212
4215
  if (a.hash === "") {
4213
- // No hash -> hash
4216
+ // /page -> /page#hash
4214
4217
  return b.hash !== "";
4215
4218
  } else if (a.hash === b.hash) {
4216
- // current hash -> same hash
4219
+ // /page#hash -> /page#hash
4217
4220
  return true;
4218
4221
  } else if (b.hash !== "") {
4219
- // current hash -> new hash
4222
+ // /page#hash -> /page#other
4220
4223
  return true;
4221
- }
4224
+ } // If the hash is removed the browser will re-perform a request to the server
4225
+ // /page#hash -> /page
4226
+
4222
4227
 
4223
4228
  return false;
4224
4229
  }