@tanstack/react-router 1.45.9 → 1.45.11

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/src/path.ts CHANGED
@@ -8,7 +8,13 @@ export interface Segment {
8
8
  }
9
9
 
10
10
  export function joinPaths(paths: Array<string | undefined>) {
11
- return cleanPath(paths.filter(Boolean).join('/'))
11
+ return cleanPath(
12
+ paths
13
+ .filter((val) => {
14
+ return val !== undefined
15
+ })
16
+ .join('/'),
17
+ )
12
18
  }
13
19
 
14
20
  export function cleanPath(path: string) {
@@ -89,8 +95,8 @@ export function resolvePath({
89
95
  to,
90
96
  trailingSlash = 'never',
91
97
  }: ResolvePathOptions) {
92
- base = base.replace(new RegExp(`^${basepath}`), '/')
93
- to = to.replace(new RegExp(`^${basepath}`), '/')
98
+ base = removeBasepath(basepath, base)
99
+ to = removeBasepath(basepath, to)
94
100
 
95
101
  let baseSegments = parsePathname(base)
96
102
  const toSegments = parsePathname(to)
@@ -193,7 +199,7 @@ export function parsePathname(pathname?: string): Array<Segment> {
193
199
 
194
200
  interface InterpolatePathOptions {
195
201
  path?: string
196
- params: any
202
+ params: Record<string, unknown>
197
203
  leaveWildcards?: boolean
198
204
  leaveParams?: boolean
199
205
  }
package/src/router.ts CHANGED
@@ -323,12 +323,14 @@ export interface RouterOptions<
323
323
  /**
324
324
  * A component that will be used to wrap the entire router.
325
325
  * This is useful for providing a context to the entire router.
326
+ * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
326
327
  * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)
327
328
  */
328
329
  Wrap?: (props: { children: any }) => React.JSX.Element
329
330
  /**
330
331
  * A component that will be used to wrap the inner contents of the router.
331
332
  * This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
333
+ * Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
332
334
  * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)
333
335
  */
334
336
  InnerWrap?: (props: { children: any }) => React.JSX.Element