@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/CHANGELOG.md +3 -2
- package/dist/router.cjs.js +6 -12
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.js +6 -12
- package/dist/router.js.map +1 -1
- package/dist/router.umd.js +6 -12
- package/dist/router.umd.js.map +1 -1
- package/dist/router.umd.min.js +2 -2
- package/dist/router.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/router.ts +5 -8
package/package.json
CHANGED
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
|
|
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
|
|
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
|
|
1514
|
+
return startRedirectNavigation(state, redirect);
|
|
1518
1515
|
}
|
|
1519
1516
|
|
|
1520
1517
|
// Process and commit output from loaders
|