@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 CHANGED
@@ -1,10 +1,11 @@
1
1
  # `@remix-run/router`
2
2
 
3
- ## 1.2.1-pre.0
3
+ ## 1.2.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Include submission info in `shouldRevalidate` on action redirects ([#9777](https://github.com/remix-run/react-router/pull/9777))
7
+ - Include submission info in `shouldRevalidate` on action redirects ([#9777](https://github.com/remix-run/react-router/pull/9777), [#9782](https://github.com/remix-run/react-router/pull/9782))
8
+ - Reset `actionData` on action redirect to current location ([#9772](https://github.com/remix-run/react-router/pull/9772))
8
9
 
9
10
  ## 1.2.0
10
11
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.2.1-pre.0
2
+ * @remix-run/router v1.2.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1546,17 +1546,14 @@ function createRouter(init) {
1546
1546
 
1547
1547
 
1548
1548
  function completeNavigation(location, newState) {
1549
- var _state$navigation$for;
1549
+ var _location$state;
1550
1550
 
1551
1551
  // Deduce if we're in a loading/actionReload state:
1552
1552
  // - We have committed actionData in the store
1553
- // - The current navigation was a submission
1553
+ // - The current navigation was a mutation submission
1554
1554
  // - We're past the submitting state and into the loading state
1555
- // - The location we've finished loading is different from the submission
1556
- // location, indicating we redirected from the action (avoids false
1557
- // positives for loading/submissionRedirect when actionData returned
1558
- // on a prior submission)
1559
- let isActionReload = state.actionData != null && state.navigation.formMethod != null && state.navigation.state === "loading" && ((_state$navigation$for = state.navigation.formAction) == null ? void 0 : _state$navigation$for.split("?")[0]) === location.pathname;
1555
+ // - The location being loaded is not the result of a redirect
1556
+ let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;
1560
1557
  let actionData;
1561
1558
 
1562
1559
  if (newState.actionData) {
@@ -2119,7 +2116,6 @@ function createRouter(init) {
2119
2116
  fetchers: new Map(state.fetchers)
2120
2117
  });
2121
2118
  return startRedirectNavigation(state, actionResult, {
2122
- submission,
2123
2119
  isFetchActionRedirect: true
2124
2120
  });
2125
2121
  } // Process any non-redirect errors thrown
@@ -2198,9 +2194,7 @@ function createRouter(init) {
2198
2194
  let redirect = findRedirect(results);
2199
2195
 
2200
2196
  if (redirect) {
2201
- return startRedirectNavigation(state, redirect, {
2202
- submission
2203
- });
2197
+ return startRedirectNavigation(state, redirect);
2204
2198
  } // Process and commit output from loaders
2205
2199
 
2206
2200