@tanstack/react-router 0.0.1-beta.217 → 0.0.1-beta.218
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/Matches.js +5 -3
- package/build/cjs/Matches.js.map +1 -1
- package/build/esm/index.js +5 -3
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +261 -261
- package/build/umd/index.development.js +5 -3
- 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/Matches.tsx +29 -21
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.218",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "tanstack/router",
|
|
7
7
|
"homepage": "https://tanstack.com/router",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@babel/runtime": "^7.16.7",
|
|
43
43
|
"tiny-invariant": "^1.3.1",
|
|
44
44
|
"tiny-warning": "^1.0.3",
|
|
45
|
-
"@tanstack/history": "0.0.1-beta.
|
|
45
|
+
"@tanstack/history": "0.0.1-beta.218"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "rollup --config rollup.config.js"
|
package/src/Matches.tsx
CHANGED
|
@@ -74,18 +74,20 @@ export function Match({ matches }: { matches: RouteMatch[] }) {
|
|
|
74
74
|
? React.Suspense
|
|
75
75
|
: SafeFragment
|
|
76
76
|
|
|
77
|
-
const errorComponent =
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
const errorComponent = routeErrorComponent
|
|
78
|
+
? React.useCallback(
|
|
79
|
+
(props: any) => {
|
|
80
|
+
return React.createElement(routeErrorComponent, {
|
|
81
|
+
...props,
|
|
82
|
+
useMatch: route.useMatch,
|
|
83
|
+
useRouteContext: route.useRouteContext,
|
|
84
|
+
useSearch: route.useSearch,
|
|
85
|
+
useParams: route.useParams,
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
[route],
|
|
89
|
+
)
|
|
90
|
+
: undefined
|
|
89
91
|
|
|
90
92
|
return (
|
|
91
93
|
<matchesContext.Provider value={matches}>
|
|
@@ -97,15 +99,21 @@ export function Match({ matches }: { matches: RouteMatch[] }) {
|
|
|
97
99
|
useParams: route.useParams,
|
|
98
100
|
})}
|
|
99
101
|
>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
{errorComponent ? (
|
|
103
|
+
<CatchBoundary
|
|
104
|
+
resetKey={locationKey}
|
|
105
|
+
errorComponent={errorComponent}
|
|
106
|
+
onCatch={() => {
|
|
107
|
+
warning(false, `Error in route match: ${match.id}`)
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<MatchInner match={match} />
|
|
111
|
+
</CatchBoundary>
|
|
112
|
+
) : (
|
|
113
|
+
<SafeFragment>
|
|
114
|
+
<MatchInner match={match} />
|
|
115
|
+
</SafeFragment>
|
|
116
|
+
)}
|
|
109
117
|
</ResolvedSuspenseBoundary>
|
|
110
118
|
</matchesContext.Provider>
|
|
111
119
|
)
|