@tanstack/react-router 0.0.1-beta.271 → 0.0.1-beta.273
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 +10 -7
- package/build/cjs/RouterProvider.js.map +1 -1
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +10 -7
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +351 -351
- package/build/types/router.d.ts +3 -0
- package/build/umd/index.development.js +10 -7
- 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 +19 -9
- package/src/router.ts +1 -0
package/build/types/router.d.ts
CHANGED
|
@@ -52,6 +52,9 @@ export interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends
|
|
|
52
52
|
Wrap?: (props: {
|
|
53
53
|
children: any;
|
|
54
54
|
}) => JSX.Element;
|
|
55
|
+
InnerWrap?: (props: {
|
|
56
|
+
children: any;
|
|
57
|
+
}) => JSX.Element;
|
|
55
58
|
notFoundRoute?: AnyRoute;
|
|
56
59
|
}
|
|
57
60
|
export interface RouterState<TRouteTree extends AnyRoute = AnyRoute> {
|
|
@@ -1097,13 +1097,14 @@
|
|
|
1097
1097
|
...rest?.context
|
|
1098
1098
|
}
|
|
1099
1099
|
});
|
|
1100
|
-
const
|
|
1100
|
+
const matches = router.options.InnerWrap ? /*#__PURE__*/React__namespace.createElement(router.options.InnerWrap, null, /*#__PURE__*/React__namespace.createElement(Matches, null)) : /*#__PURE__*/React__namespace.createElement(Matches, null);
|
|
1101
|
+
const provider = /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
|
|
1101
1102
|
value: router
|
|
1102
|
-
},
|
|
1103
|
+
}, matches, /*#__PURE__*/React__namespace.createElement(Transitioner, null));
|
|
1103
1104
|
if (router.options.Wrap) {
|
|
1104
|
-
return /*#__PURE__*/React__namespace.createElement(router.options.Wrap, null,
|
|
1105
|
+
return /*#__PURE__*/React__namespace.createElement(router.options.Wrap, null, provider);
|
|
1105
1106
|
}
|
|
1106
|
-
return
|
|
1107
|
+
return provider;
|
|
1107
1108
|
}
|
|
1108
1109
|
function Transitioner() {
|
|
1109
1110
|
const router = useRouter();
|
|
@@ -1168,9 +1169,11 @@
|
|
|
1168
1169
|
pathChanged: routerState.location.href !== routerState.resolvedLocation?.href
|
|
1169
1170
|
});
|
|
1170
1171
|
if (document.querySelector) {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
el
|
|
1172
|
+
if (routerState.location.hash !== '') {
|
|
1173
|
+
const el = document.getElementById(routerState.location.hash);
|
|
1174
|
+
if (el) {
|
|
1175
|
+
el.scrollIntoView();
|
|
1176
|
+
}
|
|
1174
1177
|
}
|
|
1175
1178
|
}
|
|
1176
1179
|
router.pendingMatches = [];
|