@tanstack/react-router 0.0.1-beta.200 → 0.0.1-beta.202
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/react.js +19 -4
- package/build/cjs/react.js.map +1 -1
- package/build/esm/index.js +19 -4
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +103 -103
- package/build/umd/index.development.js +19 -4
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +2 -2
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/react.tsx +21 -5
package/build/stats-react.json
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "121f-193"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "121f-195"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
22
|
-
"uid": "
|
|
22
|
+
"uid": "121f-199"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
26
|
-
"uid": "
|
|
26
|
+
"uid": "121f-201"
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
},
|
|
@@ -32,29 +32,29 @@
|
|
|
32
32
|
"children": [
|
|
33
33
|
{
|
|
34
34
|
"name": "history/build/esm/index.js",
|
|
35
|
-
"uid": "
|
|
35
|
+
"uid": "121f-197"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"name": "router-core/build/esm/index.js",
|
|
39
|
-
"uid": "
|
|
39
|
+
"uid": "121f-203"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"name": "react-router/src",
|
|
43
43
|
"children": [
|
|
44
44
|
{
|
|
45
|
-
"uid": "
|
|
45
|
+
"uid": "121f-207",
|
|
46
46
|
"name": "react.tsx"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"uid": "
|
|
49
|
+
"uid": "121f-209",
|
|
50
50
|
"name": "scroll-restoration.tsx"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
"uid": "
|
|
53
|
+
"uid": "121f-211",
|
|
54
54
|
"name": "awaited.tsx"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
"uid": "
|
|
57
|
+
"uid": "121f-213",
|
|
58
58
|
"name": "index.tsx"
|
|
59
59
|
}
|
|
60
60
|
]
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
|
-
"uid": "
|
|
65
|
+
"uid": "121f-205",
|
|
66
66
|
"name": "\u0000rollupPluginBabelHelpers.js"
|
|
67
67
|
}
|
|
68
68
|
]
|
|
@@ -71,323 +71,323 @@
|
|
|
71
71
|
"isRoot": true
|
|
72
72
|
},
|
|
73
73
|
"nodeParts": {
|
|
74
|
-
"
|
|
74
|
+
"121f-193": {
|
|
75
75
|
"renderedLength": 1843,
|
|
76
76
|
"gzipLength": 644,
|
|
77
77
|
"brotliLength": 0,
|
|
78
|
-
"mainUid": "
|
|
78
|
+
"mainUid": "121f-192"
|
|
79
79
|
},
|
|
80
|
-
"
|
|
80
|
+
"121f-195": {
|
|
81
81
|
"renderedLength": 1006,
|
|
82
82
|
"gzipLength": 479,
|
|
83
83
|
"brotliLength": 0,
|
|
84
|
-
"mainUid": "
|
|
84
|
+
"mainUid": "121f-194"
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"121f-197": {
|
|
87
87
|
"renderedLength": 9148,
|
|
88
88
|
"gzipLength": 2726,
|
|
89
89
|
"brotliLength": 0,
|
|
90
|
-
"mainUid": "
|
|
90
|
+
"mainUid": "121f-196"
|
|
91
91
|
},
|
|
92
|
-
"
|
|
92
|
+
"121f-199": {
|
|
93
93
|
"renderedLength": 181,
|
|
94
94
|
"gzipLength": 129,
|
|
95
95
|
"brotliLength": 0,
|
|
96
|
-
"mainUid": "
|
|
96
|
+
"mainUid": "121f-198"
|
|
97
97
|
},
|
|
98
|
-
"
|
|
98
|
+
"121f-201": {
|
|
99
99
|
"renderedLength": 44,
|
|
100
100
|
"gzipLength": 62,
|
|
101
101
|
"brotliLength": 0,
|
|
102
|
-
"mainUid": "
|
|
102
|
+
"mainUid": "121f-200"
|
|
103
103
|
},
|
|
104
|
-
"
|
|
104
|
+
"121f-203": {
|
|
105
105
|
"renderedLength": 62475,
|
|
106
106
|
"gzipLength": 14922,
|
|
107
107
|
"brotliLength": 0,
|
|
108
|
-
"mainUid": "
|
|
108
|
+
"mainUid": "121f-202"
|
|
109
109
|
},
|
|
110
|
-
"
|
|
110
|
+
"121f-205": {
|
|
111
111
|
"renderedLength": 429,
|
|
112
112
|
"gzipLength": 238,
|
|
113
113
|
"brotliLength": 0,
|
|
114
|
-
"mainUid": "
|
|
114
|
+
"mainUid": "121f-204"
|
|
115
115
|
},
|
|
116
|
-
"
|
|
117
|
-
"renderedLength":
|
|
118
|
-
"gzipLength":
|
|
116
|
+
"121f-207": {
|
|
117
|
+
"renderedLength": 17497,
|
|
118
|
+
"gzipLength": 3838,
|
|
119
119
|
"brotliLength": 0,
|
|
120
|
-
"mainUid": "
|
|
120
|
+
"mainUid": "121f-206"
|
|
121
121
|
},
|
|
122
|
-
"
|
|
122
|
+
"121f-209": {
|
|
123
123
|
"renderedLength": 466,
|
|
124
124
|
"gzipLength": 228,
|
|
125
125
|
"brotliLength": 0,
|
|
126
|
-
"mainUid": "
|
|
126
|
+
"mainUid": "121f-208"
|
|
127
127
|
},
|
|
128
|
-
"
|
|
128
|
+
"121f-211": {
|
|
129
129
|
"renderedLength": 641,
|
|
130
130
|
"gzipLength": 305,
|
|
131
131
|
"brotliLength": 0,
|
|
132
|
-
"mainUid": "
|
|
132
|
+
"mainUid": "121f-210"
|
|
133
133
|
},
|
|
134
|
-
"
|
|
134
|
+
"121f-213": {
|
|
135
135
|
"renderedLength": 0,
|
|
136
136
|
"gzipLength": 0,
|
|
137
137
|
"brotliLength": 0,
|
|
138
|
-
"mainUid": "
|
|
138
|
+
"mainUid": "121f-212"
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
"nodeMetas": {
|
|
142
|
-
"
|
|
142
|
+
"121f-192": {
|
|
143
143
|
"id": "/node_modules/.pnpm/@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
144
144
|
"moduleParts": {
|
|
145
|
-
"index.production.js": "
|
|
145
|
+
"index.production.js": "121f-193"
|
|
146
146
|
},
|
|
147
147
|
"imported": [],
|
|
148
148
|
"importedBy": [
|
|
149
149
|
{
|
|
150
|
-
"uid": "
|
|
150
|
+
"uid": "121f-194"
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
|
-
"uid": "
|
|
153
|
+
"uid": "121f-202"
|
|
154
154
|
}
|
|
155
155
|
]
|
|
156
156
|
},
|
|
157
|
-
"
|
|
157
|
+
"121f-194": {
|
|
158
158
|
"id": "/node_modules/.pnpm/@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
159
159
|
"moduleParts": {
|
|
160
|
-
"index.production.js": "
|
|
160
|
+
"index.production.js": "121f-195"
|
|
161
161
|
},
|
|
162
162
|
"imported": [
|
|
163
163
|
{
|
|
164
|
-
"uid": "
|
|
164
|
+
"uid": "121f-214"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
"uid": "
|
|
167
|
+
"uid": "121f-192"
|
|
168
168
|
}
|
|
169
169
|
],
|
|
170
170
|
"importedBy": [
|
|
171
171
|
{
|
|
172
|
-
"uid": "
|
|
172
|
+
"uid": "121f-212"
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
|
-
"uid": "
|
|
175
|
+
"uid": "121f-206"
|
|
176
176
|
}
|
|
177
177
|
]
|
|
178
178
|
},
|
|
179
|
-
"
|
|
179
|
+
"121f-196": {
|
|
180
180
|
"id": "/packages/history/build/esm/index.js",
|
|
181
181
|
"moduleParts": {
|
|
182
|
-
"index.production.js": "
|
|
182
|
+
"index.production.js": "121f-197"
|
|
183
183
|
},
|
|
184
184
|
"imported": [],
|
|
185
185
|
"importedBy": [
|
|
186
186
|
{
|
|
187
|
-
"uid": "
|
|
187
|
+
"uid": "121f-202"
|
|
188
188
|
}
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
|
-
"
|
|
191
|
+
"121f-198": {
|
|
192
192
|
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
193
193
|
"moduleParts": {
|
|
194
|
-
"index.production.js": "
|
|
194
|
+
"index.production.js": "121f-199"
|
|
195
195
|
},
|
|
196
196
|
"imported": [],
|
|
197
197
|
"importedBy": [
|
|
198
198
|
{
|
|
199
|
-
"uid": "
|
|
199
|
+
"uid": "121f-202"
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
|
-
"uid": "
|
|
202
|
+
"uid": "121f-206"
|
|
203
203
|
}
|
|
204
204
|
]
|
|
205
205
|
},
|
|
206
|
-
"
|
|
206
|
+
"121f-200": {
|
|
207
207
|
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
208
208
|
"moduleParts": {
|
|
209
|
-
"index.production.js": "
|
|
209
|
+
"index.production.js": "121f-201"
|
|
210
210
|
},
|
|
211
211
|
"imported": [],
|
|
212
212
|
"importedBy": [
|
|
213
213
|
{
|
|
214
|
-
"uid": "
|
|
214
|
+
"uid": "121f-202"
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
"uid": "
|
|
217
|
+
"uid": "121f-206"
|
|
218
218
|
}
|
|
219
219
|
]
|
|
220
220
|
},
|
|
221
|
-
"
|
|
221
|
+
"121f-202": {
|
|
222
222
|
"id": "/packages/router-core/build/esm/index.js",
|
|
223
223
|
"moduleParts": {
|
|
224
|
-
"index.production.js": "
|
|
224
|
+
"index.production.js": "121f-203"
|
|
225
225
|
},
|
|
226
226
|
"imported": [
|
|
227
227
|
{
|
|
228
|
-
"uid": "
|
|
228
|
+
"uid": "121f-196"
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
"uid": "
|
|
231
|
+
"uid": "121f-198"
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
|
-
"uid": "
|
|
234
|
+
"uid": "121f-200"
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
"uid": "
|
|
237
|
+
"uid": "121f-192"
|
|
238
238
|
}
|
|
239
239
|
],
|
|
240
240
|
"importedBy": [
|
|
241
241
|
{
|
|
242
|
-
"uid": "
|
|
242
|
+
"uid": "121f-212"
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
|
-
"uid": "
|
|
245
|
+
"uid": "121f-206"
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
|
-
"uid": "
|
|
248
|
+
"uid": "121f-208"
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
|
-
"uid": "
|
|
251
|
+
"uid": "121f-210"
|
|
252
252
|
}
|
|
253
253
|
]
|
|
254
254
|
},
|
|
255
|
-
"
|
|
255
|
+
"121f-204": {
|
|
256
256
|
"id": "\u0000rollupPluginBabelHelpers.js",
|
|
257
257
|
"moduleParts": {
|
|
258
|
-
"index.production.js": "
|
|
258
|
+
"index.production.js": "121f-205"
|
|
259
259
|
},
|
|
260
260
|
"imported": [],
|
|
261
261
|
"importedBy": [
|
|
262
262
|
{
|
|
263
|
-
"uid": "
|
|
263
|
+
"uid": "121f-206"
|
|
264
264
|
}
|
|
265
265
|
]
|
|
266
266
|
},
|
|
267
|
-
"
|
|
267
|
+
"121f-206": {
|
|
268
268
|
"id": "/packages/react-router/src/react.tsx",
|
|
269
269
|
"moduleParts": {
|
|
270
|
-
"index.production.js": "
|
|
270
|
+
"index.production.js": "121f-207"
|
|
271
271
|
},
|
|
272
272
|
"imported": [
|
|
273
273
|
{
|
|
274
|
-
"uid": "
|
|
274
|
+
"uid": "121f-204"
|
|
275
275
|
},
|
|
276
276
|
{
|
|
277
|
-
"uid": "
|
|
277
|
+
"uid": "121f-215"
|
|
278
278
|
},
|
|
279
279
|
{
|
|
280
|
-
"uid": "
|
|
280
|
+
"uid": "121f-194"
|
|
281
281
|
},
|
|
282
282
|
{
|
|
283
|
-
"uid": "
|
|
283
|
+
"uid": "121f-198"
|
|
284
284
|
},
|
|
285
285
|
{
|
|
286
|
-
"uid": "
|
|
286
|
+
"uid": "121f-200"
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
|
-
"uid": "
|
|
289
|
+
"uid": "121f-202"
|
|
290
290
|
}
|
|
291
291
|
],
|
|
292
292
|
"importedBy": [
|
|
293
293
|
{
|
|
294
|
-
"uid": "
|
|
294
|
+
"uid": "121f-212"
|
|
295
295
|
},
|
|
296
296
|
{
|
|
297
|
-
"uid": "
|
|
297
|
+
"uid": "121f-208"
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
|
-
"uid": "
|
|
300
|
+
"uid": "121f-210"
|
|
301
301
|
}
|
|
302
302
|
]
|
|
303
303
|
},
|
|
304
|
-
"
|
|
304
|
+
"121f-208": {
|
|
305
305
|
"id": "/packages/react-router/src/scroll-restoration.tsx",
|
|
306
306
|
"moduleParts": {
|
|
307
|
-
"index.production.js": "
|
|
307
|
+
"index.production.js": "121f-209"
|
|
308
308
|
},
|
|
309
309
|
"imported": [
|
|
310
310
|
{
|
|
311
|
-
"uid": "
|
|
311
|
+
"uid": "121f-215"
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
|
-
"uid": "
|
|
314
|
+
"uid": "121f-202"
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
|
-
"uid": "
|
|
317
|
+
"uid": "121f-206"
|
|
318
318
|
}
|
|
319
319
|
],
|
|
320
320
|
"importedBy": [
|
|
321
321
|
{
|
|
322
|
-
"uid": "
|
|
322
|
+
"uid": "121f-212"
|
|
323
323
|
}
|
|
324
324
|
]
|
|
325
325
|
},
|
|
326
|
-
"
|
|
326
|
+
"121f-210": {
|
|
327
327
|
"id": "/packages/react-router/src/awaited.tsx",
|
|
328
328
|
"moduleParts": {
|
|
329
|
-
"index.production.js": "
|
|
329
|
+
"index.production.js": "121f-211"
|
|
330
330
|
},
|
|
331
331
|
"imported": [
|
|
332
332
|
{
|
|
333
|
-
"uid": "
|
|
333
|
+
"uid": "121f-202"
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"uid": "
|
|
336
|
+
"uid": "121f-206"
|
|
337
337
|
}
|
|
338
338
|
],
|
|
339
339
|
"importedBy": [
|
|
340
340
|
{
|
|
341
|
-
"uid": "
|
|
341
|
+
"uid": "121f-212"
|
|
342
342
|
}
|
|
343
343
|
]
|
|
344
344
|
},
|
|
345
|
-
"
|
|
345
|
+
"121f-212": {
|
|
346
346
|
"id": "/packages/react-router/src/index.tsx",
|
|
347
347
|
"moduleParts": {
|
|
348
|
-
"index.production.js": "
|
|
348
|
+
"index.production.js": "121f-213"
|
|
349
349
|
},
|
|
350
350
|
"imported": [
|
|
351
351
|
{
|
|
352
|
-
"uid": "
|
|
352
|
+
"uid": "121f-194"
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
|
-
"uid": "
|
|
355
|
+
"uid": "121f-202"
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
|
-
"uid": "
|
|
358
|
+
"uid": "121f-206"
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
"uid": "
|
|
361
|
+
"uid": "121f-208"
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
|
-
"uid": "
|
|
364
|
+
"uid": "121f-210"
|
|
365
365
|
}
|
|
366
366
|
],
|
|
367
367
|
"importedBy": [],
|
|
368
368
|
"isEntry": true
|
|
369
369
|
},
|
|
370
|
-
"
|
|
370
|
+
"121f-214": {
|
|
371
371
|
"id": "use-sync-external-store/shim/with-selector",
|
|
372
372
|
"moduleParts": {},
|
|
373
373
|
"imported": [],
|
|
374
374
|
"importedBy": [
|
|
375
375
|
{
|
|
376
|
-
"uid": "
|
|
376
|
+
"uid": "121f-194"
|
|
377
377
|
}
|
|
378
378
|
],
|
|
379
379
|
"isExternal": true
|
|
380
380
|
},
|
|
381
|
-
"
|
|
381
|
+
"121f-215": {
|
|
382
382
|
"id": "react",
|
|
383
383
|
"moduleParts": {},
|
|
384
384
|
"imported": [],
|
|
385
385
|
"importedBy": [
|
|
386
386
|
{
|
|
387
|
-
"uid": "
|
|
387
|
+
"uid": "121f-206"
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
|
-
"uid": "
|
|
390
|
+
"uid": "121f-208"
|
|
391
391
|
}
|
|
392
392
|
],
|
|
393
393
|
"isExternal": true
|
|
@@ -2419,6 +2419,9 @@
|
|
|
2419
2419
|
|
|
2420
2420
|
function useLinkProps(options) {
|
|
2421
2421
|
const router = useRouter();
|
|
2422
|
+
const match = useMatch({
|
|
2423
|
+
strict: false
|
|
2424
|
+
});
|
|
2422
2425
|
const {
|
|
2423
2426
|
// custom props
|
|
2424
2427
|
type,
|
|
@@ -2430,11 +2433,10 @@
|
|
|
2430
2433
|
inactiveProps = () => ({}),
|
|
2431
2434
|
activeOptions,
|
|
2432
2435
|
disabled,
|
|
2433
|
-
// fromCurrent,
|
|
2434
2436
|
hash,
|
|
2435
2437
|
search,
|
|
2436
2438
|
params,
|
|
2437
|
-
to
|
|
2439
|
+
to,
|
|
2438
2440
|
state,
|
|
2439
2441
|
mask,
|
|
2440
2442
|
preload,
|
|
@@ -2450,7 +2452,10 @@
|
|
|
2450
2452
|
onTouchStart,
|
|
2451
2453
|
...rest
|
|
2452
2454
|
} = options;
|
|
2453
|
-
const linkInfo = router.buildLink(
|
|
2455
|
+
const linkInfo = router.buildLink({
|
|
2456
|
+
from: options.to ? match.pathname : undefined,
|
|
2457
|
+
...options
|
|
2458
|
+
});
|
|
2454
2459
|
if (linkInfo.type === 'external') {
|
|
2455
2460
|
const {
|
|
2456
2461
|
href
|
|
@@ -2524,8 +2529,14 @@
|
|
|
2524
2529
|
});
|
|
2525
2530
|
function Navigate(props) {
|
|
2526
2531
|
const router = useRouter();
|
|
2532
|
+
const match = useMatch({
|
|
2533
|
+
strict: false
|
|
2534
|
+
});
|
|
2527
2535
|
useLayoutEffect$1(() => {
|
|
2528
|
-
router.navigate(
|
|
2536
|
+
router.navigate({
|
|
2537
|
+
from: props.to ? match.pathname : undefined,
|
|
2538
|
+
...props
|
|
2539
|
+
});
|
|
2529
2540
|
}, []);
|
|
2530
2541
|
return null;
|
|
2531
2542
|
}
|
|
@@ -2654,8 +2665,12 @@
|
|
|
2654
2665
|
}
|
|
2655
2666
|
function useNavigate(defaultOpts) {
|
|
2656
2667
|
const router = useRouter();
|
|
2668
|
+
const match = useMatch({
|
|
2669
|
+
strict: false
|
|
2670
|
+
});
|
|
2657
2671
|
return React__namespace.useCallback(opts => {
|
|
2658
2672
|
return router.navigate({
|
|
2673
|
+
from: opts?.to ? match.pathname : undefined,
|
|
2659
2674
|
...defaultOpts,
|
|
2660
2675
|
...opts
|
|
2661
2676
|
});
|