@tanstack/react-router 1.0.6 → 1.0.7
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 +5 -2
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/esm/index.js +5 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +353 -353
- package/build/umd/index.development.js +5 -2
- 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 +15 -5
|
@@ -1093,6 +1093,9 @@
|
|
|
1093
1093
|
});
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
+
const useTransition = React__namespace.useTransition || (() => [false, cb => {
|
|
1097
|
+
cb();
|
|
1098
|
+
}]);
|
|
1096
1099
|
exports.routerContext = /*#__PURE__*/React__namespace.createContext(null);
|
|
1097
1100
|
if (typeof document !== 'undefined') {
|
|
1098
1101
|
if (window.__TSR_ROUTER_CONTEXT__) {
|
|
@@ -1129,7 +1132,7 @@
|
|
|
1129
1132
|
const routerState = useRouterState({
|
|
1130
1133
|
select: s => pick(s, ['isLoading', 'location', 'resolvedLocation', 'isTransitioning'])
|
|
1131
1134
|
});
|
|
1132
|
-
const [isTransitioning, startReactTransition] =
|
|
1135
|
+
const [isTransitioning, startReactTransition] = useTransition();
|
|
1133
1136
|
router.startReactTransition = startReactTransition;
|
|
1134
1137
|
React__namespace.useEffect(() => {
|
|
1135
1138
|
if (isTransitioning) {
|
|
@@ -1179,7 +1182,7 @@
|
|
|
1179
1182
|
};
|
|
1180
1183
|
}, [router.history]);
|
|
1181
1184
|
useLayoutEffect$1(() => {
|
|
1182
|
-
if (routerState.isTransitioning && !isTransitioning
|
|
1185
|
+
if (React__namespace.useTransition ? routerState.isTransitioning && !isTransitioning : !routerState.isLoading && routerState.resolvedLocation !== routerState.location) {
|
|
1183
1186
|
router.emit({
|
|
1184
1187
|
type: 'onResolved',
|
|
1185
1188
|
fromLocation: routerState.resolvedLocation,
|