@argon-router/react 0.6.0 → 0.6.2
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/README.md +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +26 -28
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Router without a headache
|
|
4
4
|
|
|
5
5
|
> [!WARNING]
|
|
6
|
-
> argon-router is
|
|
6
|
+
> argon-router is not production ready yet and still may have bugs and unstable API. If you found bug — please report it on GitHub.
|
|
7
7
|
|
|
8
8
|
## Documentation
|
|
9
9
|
|
|
@@ -13,6 +13,7 @@ For additional information, guides and api reference visit [documentation site](
|
|
|
13
13
|
|
|
14
14
|
- [@argon-router/core](https://www.npmjs.com/package/@argon-router/core)
|
|
15
15
|
- [@argon-router/react](https://www.npmjs.com/package/@argon-router/react)
|
|
16
|
+
- [@argon-router/paths](https://www.npmjs.com/package/@argon-router/paths)
|
|
16
17
|
|
|
17
18
|
## Installation
|
|
18
19
|
|
package/dist/index.cjs
CHANGED
|
@@ -28,4 +28,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
28
28
|
|
|
29
29
|
Check the render method of \``+t+"`."),r||(e=a(e))&&(r=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+e+">."),r}var he=y,Y=Symbol.for("react.transitional.element"),Te=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),Q=Symbol.iterator,pe=Symbol.for("react.client.reference"),_=he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,h=Object.assign,Ce=Symbol.for("react.client.reference"),z=Array.isArray,p=0,ee,re,te,oe,ne,ae,ue;b.__reactDisabledLog=!0;var J,se,L=!1,G=new(typeof WeakMap=="function"?WeakMap:Map),Se=Symbol.for("react.client.reference"),le,ie={},ce={},fe={};O.Fragment=M,O.jsx=function(e,r,t,n,c){return F(e,r,t,!1,n,c)},O.jsxs=function(e,r,t,n,c){return F(e,r,t,!0,n,c)}}()),O}var Ee;function Ne(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?N.exports=Oe():N.exports=Ae()),N.exports}var d=Ne();const ge=y.createContext(null),Pe=a=>d.jsx(ge.Provider,{value:a.router,children:a.children});function me(){const a=y.useContext(ge);if(!a)throw new Error("[useRouter] Router not found. Add RouterProvider in app root");return a}function Re(){return be.useUnit(me())}const Ye=y.forwardRef((a,v)=>{const{to:s,params:b,onClick:l,...i}=a,{mappedRoutes:E}=me(),m=E.find(({route:g})=>g===s),{onOpen:j}=be.useUnit(s);if(!m)throw new Error(`[Link] Route with path "${s.path}" not found. Maybe it is not passed into createRouter?`);return d.jsx("a",{...i,ref:v,href:m.build(b??void 0),onClick:g=>{l==null||l(g),!g.defaultPrevented&&(i.target&&i.target!=="_self"||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey||(g.preventDefault(),j({params:b||{}})))}})}),Me=a=>({route:a.route,view:()=>{const{view:v,layout:s}=a;return s?d.jsx(s,{children:d.jsx(v,{})}):d.jsx(v,{})}}),$e=a=>{const{routes:v,otherwise:s}=a;return()=>{const{activeRoutes:b}=Re(),l=b.reduce((E,m)=>E.filter(j=>j!==m.
|
|
31
|
+
Check the top-level render call using <`+e+">."),r}var he=y,Y=Symbol.for("react.transitional.element"),Te=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),Q=Symbol.iterator,pe=Symbol.for("react.client.reference"),_=he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,h=Object.assign,Ce=Symbol.for("react.client.reference"),z=Array.isArray,p=0,ee,re,te,oe,ne,ae,ue;b.__reactDisabledLog=!0;var J,se,L=!1,G=new(typeof WeakMap=="function"?WeakMap:Map),Se=Symbol.for("react.client.reference"),le,ie={},ce={},fe={};O.Fragment=M,O.jsx=function(e,r,t,n,c){return F(e,r,t,!1,n,c)},O.jsxs=function(e,r,t,n,c){return F(e,r,t,!0,n,c)}}()),O}var Ee;function Ne(){return Ee||(Ee=1,process.env.NODE_ENV==="production"?N.exports=Oe():N.exports=Ae()),N.exports}var d=Ne();const ge=y.createContext(null),Pe=a=>d.jsx(ge.Provider,{value:a.router,children:a.children});function me(){const a=y.useContext(ge);if(!a)throw new Error("[useRouter] Router not found. Add RouterProvider in app root");return a}function Re(){return be.useUnit(me())}const Ye=y.forwardRef((a,v)=>{const{to:s,params:b,onClick:l,...i}=a,{mappedRoutes:E}=me(),m=E.find(({route:g})=>g===s),{onOpen:j}=be.useUnit(s);if(!m)throw new Error(`[Link] Route with path "${s.path}" not found. Maybe it is not passed into createRouter?`);return d.jsx("a",{...i,ref:v,href:m.build(b??void 0),onClick:g=>{l==null||l(g),!g.defaultPrevented&&(i.target&&i.target!=="_self"||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey||(g.preventDefault(),j({params:b||{}})))}})}),Me=a=>({route:a.route,view:()=>{const{view:v,layout:s}=a;return s?d.jsx(s,{children:d.jsx(v,{})}):d.jsx(v,{})}}),$e=a=>{const{routes:v,otherwise:s}=a;return()=>{const{activeRoutes:b}=Re(),l=b.reduce((E,m)=>E.filter(j=>j!==m.parent),b),i=v.find(E=>E.route===l.at(-1));return i?y.createElement(i.view):s?d.jsx(s,{}):null}},Ve=a=>{a.route.internal.setAsyncImport(a.view);const v=y.lazy(a.view);return{route:a.route,view:()=>{const{layout:s,fallback:b=()=>d.jsx(d.Fragment,{})}=a;return s?d.jsx(s,{children:d.jsx(y.Suspense,{fallback:d.jsx(b,{}),children:d.jsx(v,{})})}):d.jsx(y.Suspense,{fallback:d.jsx(b,{}),children:d.jsx(v,{})})}}};exports.Link=Ye;exports.RouterProvider=Pe;exports.createLazyRouteView=Ve;exports.createRouteView=Me;exports.createRoutesView=$e;exports.useRouter=Re;
|
package/dist/index.d.ts
CHANGED
|
@@ -19,10 +19,34 @@ declare type BaseLinkProps<Params> = {
|
|
|
19
19
|
declare interface CreateBaseRouteViewProps {
|
|
20
20
|
route: Route<any>;
|
|
21
21
|
layout?: ComponentType<{
|
|
22
|
-
children
|
|
22
|
+
children: ReactNode;
|
|
23
23
|
}>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @description Creates Lazy route view with async bundle load
|
|
28
|
+
* @link https://movpushmov.dev/argon-router/react/create-lazy-route-view.html
|
|
29
|
+
* @param props Lazy route view props
|
|
30
|
+
* @returns RouteView
|
|
31
|
+
* @example ```ts
|
|
32
|
+
* // profile.tsx
|
|
33
|
+
* export default function () {
|
|
34
|
+
* return <>...</>;
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* // index.ts
|
|
38
|
+
* import { createLazyRouteView } from '@argon-router/react';
|
|
39
|
+
* import { routes } from '@shared/routing';
|
|
40
|
+
* import { MainLayout } from '@layouts';
|
|
41
|
+
*
|
|
42
|
+
* export const ProfileScreen = createLazyRouteView({
|
|
43
|
+
* route: routes.profile,
|
|
44
|
+
* view: () => import('./profile'),
|
|
45
|
+
* fallback: () => ':(',
|
|
46
|
+
* layout: MainLayout,
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
26
50
|
export declare const createLazyRouteView: (props: CreateLazyRouteViewProps) => RouteView;
|
|
27
51
|
|
|
28
52
|
export declare interface CreateLazyRouteViewProps extends CreateBaseRouteViewProps {
|
|
@@ -32,6 +56,29 @@ export declare interface CreateLazyRouteViewProps extends CreateBaseRouteViewPro
|
|
|
32
56
|
fallback?: ComponentType;
|
|
33
57
|
}
|
|
34
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @description Create routes view which renders current opened route. `Don't forget add <RouterProvider>`!
|
|
61
|
+
* @param props Routes view config
|
|
62
|
+
* @link https://movpushmov.dev/argon-router/react/create-routes-view.html
|
|
63
|
+
* @returns RoutesView
|
|
64
|
+
* @example ```tsx
|
|
65
|
+
* import { createRoutesView } from '@argon-router/react';
|
|
66
|
+
* import { router } from './router';
|
|
67
|
+
* // feed screen & profile screen must be created with createRouteView!
|
|
68
|
+
* import { FeedScreen, ProfileScreen } from './screens';
|
|
69
|
+
*
|
|
70
|
+
* const RoutesView = createRoutesView({ routes: [FeedScreen, ProfileScreen] });
|
|
71
|
+
*
|
|
72
|
+
* // then you can use it like react component:
|
|
73
|
+
* function App() {
|
|
74
|
+
* return (
|
|
75
|
+
* <RouterProvider router={router}>
|
|
76
|
+
* <RoutesView />
|
|
77
|
+
* </RouterProvider>
|
|
78
|
+
* );
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
35
82
|
export declare const createRoutesView: (props: CreateRoutesViewProps) => () => JSX.Element | null;
|
|
36
83
|
|
|
37
84
|
declare interface CreateRoutesViewProps {
|
|
@@ -39,6 +86,27 @@ declare interface CreateRoutesViewProps {
|
|
|
39
86
|
otherwise?: ComponentType;
|
|
40
87
|
}
|
|
41
88
|
|
|
89
|
+
/**
|
|
90
|
+
* @description Creates Route view without async bundle load
|
|
91
|
+
* @link https://movpushmov.dev/argon-router/react/create-route-view.html
|
|
92
|
+
* @param props Route view props
|
|
93
|
+
* @returns RouteView
|
|
94
|
+
* @example ```ts
|
|
95
|
+
* import { createRouteView } from '@argon-router/react';
|
|
96
|
+
* import { routes } from '@shared/routing';
|
|
97
|
+
* import { MainLayout } from '@layouts';
|
|
98
|
+
*
|
|
99
|
+
* function Profile() {
|
|
100
|
+
* return <>...</>;
|
|
101
|
+
* }
|
|
102
|
+
*
|
|
103
|
+
* export const ProfileScreen = createRouteView({
|
|
104
|
+
* route: routes.profile,
|
|
105
|
+
* view: Profile,
|
|
106
|
+
* layout: MainLayout,
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
42
110
|
export declare const createRouteView: (props: CreateRouteViewProps) => RouteView;
|
|
43
111
|
|
|
44
112
|
export declare interface CreateRouteViewProps extends CreateBaseRouteViewProps {
|
|
@@ -49,6 +117,28 @@ declare type ForwardedLink = <Params = void>(props: LinkProps<Params> & {
|
|
|
49
117
|
ref?: ForwardedRef<HTMLAnchorElement>;
|
|
50
118
|
}) => ReactNode;
|
|
51
119
|
|
|
120
|
+
/**
|
|
121
|
+
* @description Navigates user to provided route on click
|
|
122
|
+
* @link https://movpushmov.dev/argon-router/react/link.html
|
|
123
|
+
* @example ```tsx
|
|
124
|
+
* import { Link } from '@argon-router/react';
|
|
125
|
+
* import { routes } from '@shared/routing';
|
|
126
|
+
*
|
|
127
|
+
* function Profile({ user }) {
|
|
128
|
+
* return (
|
|
129
|
+
* <>
|
|
130
|
+
* <Link to={routes.settings}>Settings</Link>
|
|
131
|
+
*
|
|
132
|
+
* {user.posts.map((post) => (
|
|
133
|
+
* <Link to={routes.editPost} params={{ id: post.id }}>
|
|
134
|
+
* Edit post
|
|
135
|
+
* </Link>
|
|
136
|
+
* ))}
|
|
137
|
+
* </>
|
|
138
|
+
* );
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
52
142
|
export declare const Link: ForwardedLink;
|
|
53
143
|
|
|
54
144
|
export declare type LinkProps<Params> = Params extends Record<string, never> | void | undefined ? BaseLinkProps<Params> & {
|
|
@@ -57,6 +147,10 @@ export declare type LinkProps<Params> = Params extends Record<string, never> | v
|
|
|
57
147
|
params: Params;
|
|
58
148
|
};
|
|
59
149
|
|
|
150
|
+
/**
|
|
151
|
+
* @description Provides router in React tree
|
|
152
|
+
* @param props Router provider config
|
|
153
|
+
*/
|
|
60
154
|
export declare const RouterProvider: (props: RouterProviderProps) => JSX.Element;
|
|
61
155
|
|
|
62
156
|
declare interface RouterProviderProps {
|
|
@@ -69,6 +163,11 @@ export declare interface RouteView {
|
|
|
69
163
|
view: FC;
|
|
70
164
|
}
|
|
71
165
|
|
|
166
|
+
/**
|
|
167
|
+
* @description Use router from provider
|
|
168
|
+
* @returns Router
|
|
169
|
+
* @link https://movpushmov.dev/argon-router/react/use-router.html
|
|
170
|
+
*/
|
|
72
171
|
export declare function useRouter(): {
|
|
73
172
|
query: Query;
|
|
74
173
|
path: string;
|
package/dist/index.js
CHANGED
|
@@ -15,22 +15,22 @@ function Me() {
|
|
|
15
15
|
if (de) return C;
|
|
16
16
|
de = 1;
|
|
17
17
|
var a = Symbol.for("react.transitional.element"), v = Symbol.for("react.fragment");
|
|
18
|
-
function
|
|
18
|
+
function s(b, l, i) {
|
|
19
19
|
var E = null;
|
|
20
|
-
if (i !== void 0 && (E = "" + i),
|
|
20
|
+
if (i !== void 0 && (E = "" + i), l.key !== void 0 && (E = "" + l.key), "key" in l) {
|
|
21
21
|
i = {};
|
|
22
|
-
for (var g in
|
|
23
|
-
g !== "key" && (i[g] =
|
|
24
|
-
} else i =
|
|
25
|
-
return
|
|
22
|
+
for (var g in l)
|
|
23
|
+
g !== "key" && (i[g] = l[g]);
|
|
24
|
+
} else i = l;
|
|
25
|
+
return l = i.ref, {
|
|
26
26
|
$$typeof: a,
|
|
27
27
|
type: b,
|
|
28
28
|
key: E,
|
|
29
|
-
ref:
|
|
29
|
+
ref: l !== void 0 ? l : null,
|
|
30
30
|
props: i
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return C.Fragment = v, C.jsx =
|
|
33
|
+
return C.Fragment = v, C.jsx = s, C.jsxs = s, C;
|
|
34
34
|
}
|
|
35
35
|
var A = {};
|
|
36
36
|
/**
|
|
@@ -89,7 +89,7 @@ function $e() {
|
|
|
89
89
|
function v(e) {
|
|
90
90
|
return "" + e;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function s(e) {
|
|
93
93
|
try {
|
|
94
94
|
v(e);
|
|
95
95
|
var r = !1;
|
|
@@ -108,7 +108,7 @@ function $e() {
|
|
|
108
108
|
}
|
|
109
109
|
function b() {
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function l() {
|
|
112
112
|
if (p === 0) {
|
|
113
113
|
D = console.log, ee = console.info, re = console.warn, te = console.error, oe = console.group, ne = console.groupCollapsed, ae = console.groupEnd;
|
|
114
114
|
var e = {
|
|
@@ -164,7 +164,7 @@ function $e() {
|
|
|
164
164
|
if (t !== void 0) return t;
|
|
165
165
|
J = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
|
|
166
166
|
var n = null;
|
|
167
|
-
n = j.H, j.H = null,
|
|
167
|
+
n = j.H, j.H = null, l();
|
|
168
168
|
try {
|
|
169
169
|
var c = {
|
|
170
170
|
DetermineComponentFrameRoot: function() {
|
|
@@ -299,7 +299,7 @@ function $e() {
|
|
|
299
299
|
}
|
|
300
300
|
function we(e, r) {
|
|
301
301
|
function t() {
|
|
302
|
-
|
|
302
|
+
se || (se = !0, console.error(
|
|
303
303
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
304
304
|
r
|
|
305
305
|
));
|
|
@@ -311,7 +311,7 @@ function $e() {
|
|
|
311
311
|
}
|
|
312
312
|
function Re() {
|
|
313
313
|
var e = a(this.type);
|
|
314
|
-
return
|
|
314
|
+
return le[e] || (le[e] = !0, console.error(
|
|
315
315
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
316
316
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
317
317
|
}
|
|
@@ -375,7 +375,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
375
375
|
o
|
|
376
376
|
), ie[o + n] = !0);
|
|
377
377
|
}
|
|
378
|
-
if (o = null, t !== void 0 && (
|
|
378
|
+
if (o = null, t !== void 0 && (s(t), o = "" + t), xe(r) && (s(r.key), o = "" + r.key), "key" in r) {
|
|
379
379
|
t = {};
|
|
380
380
|
for (var T in r)
|
|
381
381
|
T !== "key" && (t[T] = r[T]);
|
|
@@ -428,7 +428,7 @@ Check the top-level render call using <` + e + ">."), r;
|
|
|
428
428
|
}
|
|
429
429
|
var _e = Ae, P = Symbol.for("react.transitional.element"), he = Symbol.for("react.portal"), Y = Symbol.for("react.fragment"), X = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), K = Symbol.for("react.consumer"), I = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), Te = Symbol.for("react.offscreen"), Z = Symbol.iterator, pe = Symbol.for("react.client.reference"), j = _e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, _ = Object.assign, ke = Symbol.for("react.client.reference"), z = Array.isArray, p = 0, D, ee, re, te, oe, ne, ae;
|
|
430
430
|
b.__reactDisabledLog = !0;
|
|
431
|
-
var q, ue, J = !1, G = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ce = Symbol.for("react.client.reference"),
|
|
431
|
+
var q, ue, J = !1, G = new (typeof WeakMap == "function" ? WeakMap : Map)(), Ce = Symbol.for("react.client.reference"), se, le = {}, ie = {}, ce = {};
|
|
432
432
|
A.Fragment = Y, A.jsx = function(e, r, t, n, c) {
|
|
433
433
|
return L(e, r, t, !1, n, c);
|
|
434
434
|
}, A.jsxs = function(e, r, t, n, c) {
|
|
@@ -454,10 +454,10 @@ function Ue() {
|
|
|
454
454
|
return be(ge());
|
|
455
455
|
}
|
|
456
456
|
const Je = Ne((a, v) => {
|
|
457
|
-
const { to:
|
|
457
|
+
const { to: s, params: b, onClick: l, ...i } = a, { mappedRoutes: E } = ge(), g = E.find(({ route: m }) => m === s), { onOpen: y } = be(s);
|
|
458
458
|
if (!g)
|
|
459
459
|
throw new Error(
|
|
460
|
-
`[Link] Route with path "${
|
|
460
|
+
`[Link] Route with path "${s.path}" not found. Maybe it is not passed into createRouter?`
|
|
461
461
|
);
|
|
462
462
|
return /* @__PURE__ */ d.jsx(
|
|
463
463
|
"a",
|
|
@@ -466,25 +466,23 @@ const Je = Ne((a, v) => {
|
|
|
466
466
|
ref: v,
|
|
467
467
|
href: g.build(b ?? void 0),
|
|
468
468
|
onClick: (m) => {
|
|
469
|
-
|
|
469
|
+
l == null || l(m), !m.defaultPrevented && (i.target && i.target !== "_self" || m.metaKey || m.altKey || m.ctrlKey || m.shiftKey || (m.preventDefault(), y({ params: b || {} })));
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
);
|
|
473
473
|
}), Ge = (a) => ({
|
|
474
474
|
route: a.route,
|
|
475
475
|
view: () => {
|
|
476
|
-
const { view: v, layout:
|
|
477
|
-
return
|
|
476
|
+
const { view: v, layout: s } = a;
|
|
477
|
+
return s ? /* @__PURE__ */ d.jsx(s, { children: /* @__PURE__ */ d.jsx(v, {}) }) : /* @__PURE__ */ d.jsx(v, {});
|
|
478
478
|
}
|
|
479
479
|
}), Le = (a) => {
|
|
480
|
-
const { routes: v, otherwise:
|
|
480
|
+
const { routes: v, otherwise: s } = a;
|
|
481
481
|
return () => {
|
|
482
|
-
const { activeRoutes: b } = Ue(),
|
|
483
|
-
(
|
|
484
|
-
), b), i = v.find(
|
|
485
|
-
(E) => E.route === s.at(-1)
|
|
482
|
+
const { activeRoutes: b } = Ue(), l = b.reduce((E, g) => E.filter((y) => y !== g.parent), b), i = v.find(
|
|
483
|
+
(E) => E.route === l.at(-1)
|
|
486
484
|
);
|
|
487
|
-
return i ? Pe(i.view) :
|
|
485
|
+
return i ? Pe(i.view) : s ? /* @__PURE__ */ d.jsx(s, {}) : null;
|
|
488
486
|
};
|
|
489
487
|
}, Fe = (a) => {
|
|
490
488
|
a.route.internal.setAsyncImport(a.view);
|
|
@@ -492,8 +490,8 @@ const Je = Ne((a, v) => {
|
|
|
492
490
|
return {
|
|
493
491
|
route: a.route,
|
|
494
492
|
view: () => {
|
|
495
|
-
const { layout:
|
|
496
|
-
return
|
|
493
|
+
const { layout: s, fallback: b = () => /* @__PURE__ */ d.jsx(d.Fragment, {}) } = a;
|
|
494
|
+
return s ? /* @__PURE__ */ d.jsx(s, { children: /* @__PURE__ */ d.jsx(fe, { fallback: /* @__PURE__ */ d.jsx(b, {}), children: /* @__PURE__ */ d.jsx(v, {}) }) }) : /* @__PURE__ */ d.jsx(fe, { fallback: /* @__PURE__ */ d.jsx(b, {}), children: /* @__PURE__ */ d.jsx(v, {}) });
|
|
497
495
|
}
|
|
498
496
|
};
|
|
499
497
|
};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "0.6.
|
|
8
|
+
"version": "0.6.2",
|
|
9
9
|
"description": "React bindings for argon router",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"effector",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"url": "https://github.com/movpushmov/argon-router/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@argon-router/core": "^0.6.
|
|
47
|
+
"@argon-router/core": "^0.6.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/preset-react": "^7.26.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"effector-react": ">=23",
|
|
60
60
|
"react": "18 || 19"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8e6614b1ef46d6a67cdad7d2843e102dca189976"
|
|
63
63
|
}
|