@trackunit/react-core-contexts-test 1.3.73 → 1.3.74
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/index.cjs.js +6 -1
- package/index.esm.js +6 -1
- package/package.json +6 -5
- package/src/utils/routingUtils.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -310,7 +310,7 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
310
310
|
const client = react.useApolloClient();
|
|
311
311
|
// The current version of createMemoryHistory seem to have issues when NOT ending on / so adding a # will not effect what url is rendered but it seems to work
|
|
312
312
|
const memoryHistory = React.useRef(reactRouter.createMemoryHistory({
|
|
313
|
-
initialEntries: selectedRouterProps?.initialEntries?.map(entry => entry.path + "#") ?? ["/#"],
|
|
313
|
+
initialEntries: selectedRouterProps?.initialEntries?.reverse().map(entry => entry.path + "#") ?? ["/#"],
|
|
314
314
|
initialIndex: 0,
|
|
315
315
|
}));
|
|
316
316
|
const getChildren = React.useCallback(() => children, [children]);
|
|
@@ -347,6 +347,9 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
347
347
|
selectedRouterProps?.initialEntries?.forEach(entry => {
|
|
348
348
|
const route = pathsToRoute[entry.route];
|
|
349
349
|
if (route) {
|
|
350
|
+
if (entry.beforeLoad) {
|
|
351
|
+
route.options.beforeLoad = entry.beforeLoad;
|
|
352
|
+
}
|
|
350
353
|
if (entry.component) {
|
|
351
354
|
route.options.component = entry.component;
|
|
352
355
|
}
|
|
@@ -380,6 +383,8 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
380
383
|
return reactRouter.createRouter({
|
|
381
384
|
routeTree: localRootRoute,
|
|
382
385
|
history: memoryHistory.current,
|
|
386
|
+
defaultPendingMs: 0,
|
|
387
|
+
defaultPendingMinMs: 0, // Add this to control minimum pending time
|
|
383
388
|
context: {
|
|
384
389
|
hasAccessTo: async () => {
|
|
385
390
|
return true;
|
package/index.esm.js
CHANGED
|
@@ -308,7 +308,7 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
308
308
|
const client = useApolloClient();
|
|
309
309
|
// The current version of createMemoryHistory seem to have issues when NOT ending on / so adding a # will not effect what url is rendered but it seems to work
|
|
310
310
|
const memoryHistory = useRef(createMemoryHistory({
|
|
311
|
-
initialEntries: selectedRouterProps?.initialEntries?.map(entry => entry.path + "#") ?? ["/#"],
|
|
311
|
+
initialEntries: selectedRouterProps?.initialEntries?.reverse().map(entry => entry.path + "#") ?? ["/#"],
|
|
312
312
|
initialIndex: 0,
|
|
313
313
|
}));
|
|
314
314
|
const getChildren = useCallback(() => children, [children]);
|
|
@@ -345,6 +345,9 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
345
345
|
selectedRouterProps?.initialEntries?.forEach(entry => {
|
|
346
346
|
const route = pathsToRoute[entry.route];
|
|
347
347
|
if (route) {
|
|
348
|
+
if (entry.beforeLoad) {
|
|
349
|
+
route.options.beforeLoad = entry.beforeLoad;
|
|
350
|
+
}
|
|
348
351
|
if (entry.component) {
|
|
349
352
|
route.options.component = entry.component;
|
|
350
353
|
}
|
|
@@ -378,6 +381,8 @@ const RouterContainer = ({ addTestRootContainer, selectedRouterProps, rootRoute,
|
|
|
378
381
|
return createRouter({
|
|
379
382
|
routeTree: localRootRoute,
|
|
380
383
|
history: memoryHistory.current,
|
|
384
|
+
defaultPendingMs: 0,
|
|
385
|
+
defaultPendingMinMs: 0, // Add this to control minimum pending time
|
|
381
386
|
context: {
|
|
382
387
|
hasAccessTo: async () => {
|
|
383
388
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts-test",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.74",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
"react": "19.0.0",
|
|
13
13
|
"lodash": "4.17.21",
|
|
14
14
|
"graphql": "^16.10.0",
|
|
15
|
-
"@tanstack/react-router": "1.
|
|
16
|
-
"@
|
|
17
|
-
"@trackunit/react-core-
|
|
18
|
-
"@trackunit/
|
|
15
|
+
"@tanstack/react-router": "1.114.29",
|
|
16
|
+
"@tanstack/router-core": "1.114.29",
|
|
17
|
+
"@trackunit/react-core-contexts-api": "1.4.71",
|
|
18
|
+
"@trackunit/react-core-hooks": "1.3.73",
|
|
19
|
+
"@trackunit/shared-utils": "1.5.69"
|
|
19
20
|
},
|
|
20
21
|
"module": "./index.esm.js",
|
|
21
22
|
"main": "./index.cjs.js",
|