@tanstack/react-router 0.0.1-beta.237 → 0.0.1-beta.239
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/build/cjs/RouterProvider.js +3 -11
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/router.js +3 -1
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +6 -12
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +355 -355
- package/build/umd/index.development.js +6 -12
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/RouterProvider.tsx +10 -15
- package/src/router.ts +1 -1
package/build/esm/index.js
CHANGED
|
@@ -813,19 +813,12 @@ function RouterProvider({
|
|
|
813
813
|
});
|
|
814
814
|
const inner = /*#__PURE__*/React.createElement(routerContext.Provider, {
|
|
815
815
|
value: router
|
|
816
|
-
}, /*#__PURE__*/React.createElement(
|
|
817
|
-
router: router
|
|
818
|
-
}));
|
|
816
|
+
}, /*#__PURE__*/React.createElement(Matches, null), /*#__PURE__*/React.createElement(Transitioner, null));
|
|
819
817
|
if (router.options.Wrap) {
|
|
820
818
|
return /*#__PURE__*/React.createElement(router.options.Wrap, null, inner);
|
|
821
819
|
}
|
|
822
820
|
return inner;
|
|
823
821
|
}
|
|
824
|
-
function RouterProviderInner({
|
|
825
|
-
router
|
|
826
|
-
}) {
|
|
827
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Matches, null), /*#__PURE__*/React.createElement(Transitioner, null));
|
|
828
|
-
}
|
|
829
822
|
function Transitioner() {
|
|
830
823
|
const router = useRouter();
|
|
831
824
|
const routerState = useRouterState({
|
|
@@ -881,8 +874,7 @@ function Transitioner() {
|
|
|
881
874
|
};
|
|
882
875
|
}, [router.history]);
|
|
883
876
|
useLayoutEffect$1(() => {
|
|
884
|
-
if (!isTransitioning && !routerState.isLoading && routerState.resolvedLocation !== routerState.location) {
|
|
885
|
-
console.log('onResolved', routerState.location);
|
|
877
|
+
if (routerState.isTransitioning && !isTransitioning && !routerState.isLoading && routerState.resolvedLocation !== routerState.location) {
|
|
886
878
|
router.emit({
|
|
887
879
|
type: 'onResolved',
|
|
888
880
|
fromLocation: routerState.resolvedLocation,
|
|
@@ -896,7 +888,7 @@ function Transitioner() {
|
|
|
896
888
|
resolvedLocation: s.location
|
|
897
889
|
}));
|
|
898
890
|
}
|
|
899
|
-
}, [isTransitioning, routerState.isLoading]);
|
|
891
|
+
}, [routerState.isTransitioning, isTransitioning, routerState.isLoading, routerState.resolvedLocation, routerState.location]);
|
|
900
892
|
useLayoutEffect$1(() => {
|
|
901
893
|
if (!window.__TSR_DEHYDRATED__) {
|
|
902
894
|
tryLoad();
|
|
@@ -2313,7 +2305,9 @@ function getInitialRouterState(location) {
|
|
|
2313
2305
|
isLoading: false,
|
|
2314
2306
|
isTransitioning: false,
|
|
2315
2307
|
status: 'idle',
|
|
2316
|
-
resolvedLocation:
|
|
2308
|
+
resolvedLocation: {
|
|
2309
|
+
...location
|
|
2310
|
+
},
|
|
2317
2311
|
location,
|
|
2318
2312
|
matches: [],
|
|
2319
2313
|
pendingMatches: [],
|