@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.
@@ -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 inner = /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
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
- }, /*#__PURE__*/React__namespace.createElement(Matches, null), /*#__PURE__*/React__namespace.createElement(Transitioner, null));
1103
+ }, matches, /*#__PURE__*/React__namespace.createElement(Transitioner, null));
1103
1104
  if (router.options.Wrap) {
1104
- return /*#__PURE__*/React__namespace.createElement(router.options.Wrap, null, inner);
1105
+ return /*#__PURE__*/React__namespace.createElement(router.options.Wrap, null, provider);
1105
1106
  }
1106
- return inner;
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
- const el = document.getElementById(routerState.location.hash);
1172
- if (el) {
1173
- el.scrollIntoView();
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 = [];