@remix-run/router 1.2.1-pre.0 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix-run/router",
3
- "version": "1.2.1-pre.0",
3
+ "version": "1.2.1",
4
4
  "description": "Nested/Data-driven/Framework-agnostic Routing",
5
5
  "keywords": [
6
6
  "remix",
package/router.ts CHANGED
@@ -735,17 +735,15 @@ export function createRouter(init: RouterInit): Router {
735
735
  ): void {
736
736
  // Deduce if we're in a loading/actionReload state:
737
737
  // - We have committed actionData in the store
738
- // - The current navigation was a submission
738
+ // - The current navigation was a mutation submission
739
739
  // - We're past the submitting state and into the loading state
740
- // - The location we've finished loading is different from the submission
741
- // location, indicating we redirected from the action (avoids false
742
- // positives for loading/submissionRedirect when actionData returned
743
- // on a prior submission)
740
+ // - The location being loaded is not the result of a redirect
744
741
  let isActionReload =
745
742
  state.actionData != null &&
746
743
  state.navigation.formMethod != null &&
744
+ isMutationMethod(state.navigation.formMethod) &&
747
745
  state.navigation.state === "loading" &&
748
- state.navigation.formAction?.split("?")[0] === location.pathname;
746
+ location.state?._isRedirect !== true;
749
747
 
750
748
  let actionData: RouteData | null;
751
749
  if (newState.actionData) {
@@ -1418,7 +1416,6 @@ export function createRouter(init: RouterInit): Router {
1418
1416
  updateState({ fetchers: new Map(state.fetchers) });
1419
1417
 
1420
1418
  return startRedirectNavigation(state, actionResult, {
1421
- submission,
1422
1419
  isFetchActionRedirect: true,
1423
1420
  });
1424
1421
  }
@@ -1514,7 +1511,7 @@ export function createRouter(init: RouterInit): Router {
1514
1511
 
1515
1512
  let redirect = findRedirect(results);
1516
1513
  if (redirect) {
1517
- return startRedirectNavigation(state, redirect, { submission });
1514
+ return startRedirectNavigation(state, redirect);
1518
1515
  }
1519
1516
 
1520
1517
  // Process and commit output from loaders