@etsoo/react 1.7.94 → 1.7.96

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.
Files changed (93) hide show
  1. package/README.md +2 -1
  2. package/__tests__/EventWatcher.tsx +21 -21
  3. package/__tests__/ReactUtils.ts +4 -4
  4. package/__tests__/tsconfig.json +17 -17
  5. package/babel.config.json +8 -8
  6. package/lib/app/CoreConstants.js +2 -2
  7. package/lib/app/EventWatcher.d.ts +1 -1
  8. package/lib/app/EventWatcher.js +3 -5
  9. package/lib/app/InputDialogProps.d.ts +2 -2
  10. package/lib/app/ReactUtils.d.ts +2 -2
  11. package/lib/app/ReactUtils.js +20 -19
  12. package/lib/components/DnDList.d.ts +3 -3
  13. package/lib/components/DnDList.js +4 -4
  14. package/lib/components/DynamicRouter.d.ts +2 -2
  15. package/lib/components/DynamicRouter.js +2 -2
  16. package/lib/components/GridColumn.d.ts +6 -6
  17. package/lib/components/GridColumn.js +7 -7
  18. package/lib/components/GridLoader.d.ts +4 -4
  19. package/lib/components/GridLoader.js +2 -2
  20. package/lib/components/GridMethodRef.d.ts +2 -2
  21. package/lib/components/ListItemReact.d.ts +2 -2
  22. package/lib/components/ScrollRestoration.js +3 -3
  23. package/lib/components/ScrollerGrid.d.ts +7 -12
  24. package/lib/components/ScrollerGrid.js +13 -17
  25. package/lib/components/ScrollerList.d.ts +6 -10
  26. package/lib/components/ScrollerList.js +15 -14
  27. package/lib/custom/CustomFieldReact.d.ts +1 -1
  28. package/lib/index.d.ts +32 -32
  29. package/lib/index.js +31 -31
  30. package/lib/notifier/Notifier.d.ts +5 -5
  31. package/lib/notifier/Notifier.js +7 -7
  32. package/lib/states/CultureState.d.ts +3 -3
  33. package/lib/states/CultureState.js +3 -3
  34. package/lib/states/IState.d.ts +2 -2
  35. package/lib/states/PageState.d.ts +2 -2
  36. package/lib/states/PageState.js +2 -3
  37. package/lib/states/State.d.ts +3 -3
  38. package/lib/states/State.js +2 -2
  39. package/lib/states/UserState.d.ts +2 -2
  40. package/lib/states/UserState.js +5 -5
  41. package/lib/uses/useAsyncState.d.ts +1 -1
  42. package/lib/uses/useAsyncState.js +1 -1
  43. package/lib/uses/useCombinedRefs.js +2 -2
  44. package/lib/uses/useDelayedExecutor.d.ts +1 -1
  45. package/lib/uses/useDelayedExecutor.js +2 -2
  46. package/lib/uses/useDimensions.d.ts +1 -1
  47. package/lib/uses/useDimensions.js +3 -3
  48. package/lib/uses/useParamsEx.d.ts +1 -1
  49. package/lib/uses/useParamsEx.js +2 -2
  50. package/lib/uses/useRefs.d.ts +2 -2
  51. package/lib/uses/useRefs.js +1 -1
  52. package/lib/uses/useSearchParamsEx.d.ts +1 -1
  53. package/lib/uses/useSearchParamsEx.js +3 -3
  54. package/lib/uses/useTimeout.js +2 -2
  55. package/lib/uses/useWindowScroll.js +3 -3
  56. package/lib/uses/useWindowSize.js +4 -5
  57. package/package.json +72 -74
  58. package/src/app/CoreConstants.ts +8 -8
  59. package/src/app/EventWatcher.ts +50 -52
  60. package/src/app/InputDialogProps.ts +16 -16
  61. package/src/app/ReactUtils.ts +206 -208
  62. package/src/components/DnDList.tsx +268 -283
  63. package/src/components/DynamicRouter.tsx +35 -35
  64. package/src/components/GridColumn.ts +201 -201
  65. package/src/components/GridLoader.ts +121 -121
  66. package/src/components/GridMethodRef.ts +26 -26
  67. package/src/components/ListItemReact.ts +2 -2
  68. package/src/components/ScrollRestoration.tsx +24 -24
  69. package/src/components/ScrollerGrid.tsx +428 -448
  70. package/src/components/ScrollerList.tsx +320 -332
  71. package/src/custom/CustomFieldReact.ts +12 -12
  72. package/src/index.ts +35 -35
  73. package/src/notifier/Notifier.ts +229 -240
  74. package/src/states/CultureState.ts +51 -52
  75. package/src/states/IState.ts +19 -19
  76. package/src/states/PageState.ts +63 -66
  77. package/src/states/State.tsx +47 -51
  78. package/src/states/UserState.ts +98 -98
  79. package/src/uses/useAsyncState.ts +37 -39
  80. package/src/uses/useCombinedRefs.ts +16 -16
  81. package/src/uses/useDelayedExecutor.ts +8 -8
  82. package/src/uses/useDimensions.ts +102 -103
  83. package/src/uses/useParamsEx.ts +6 -6
  84. package/src/uses/useRefs.ts +6 -6
  85. package/src/uses/useSearchParamsEx.ts +13 -13
  86. package/src/uses/useTimeout.ts +17 -17
  87. package/src/uses/useWindowScroll.ts +43 -43
  88. package/src/uses/useWindowSize.ts +46 -49
  89. package/tsconfig.json +17 -17
  90. package/.eslintignore +0 -3
  91. package/.eslintrc.json +0 -38
  92. package/.prettierignore +0 -5
  93. package/.prettierrc +0 -6
@@ -1,137 +1,137 @@
1
1
  import {
2
- DndContext,
3
- DragEndEvent,
4
- DragStartEvent,
5
- UniqueIdentifier
6
- } from '@dnd-kit/core';
2
+ DndContext,
3
+ DragEndEvent,
4
+ DragStartEvent,
5
+ UniqueIdentifier
6
+ } from "@dnd-kit/core";
7
7
  import {
8
- SortableContext,
9
- useSortable,
10
- verticalListSortingStrategy
11
- } from '@dnd-kit/sortable';
12
- import { CSS } from '@dnd-kit/utilities';
13
- import { DataTypes } from '@etsoo/shared';
14
- import React, { CSSProperties } from 'react';
8
+ SortableContext,
9
+ useSortable,
10
+ verticalListSortingStrategy
11
+ } from "@dnd-kit/sortable";
12
+ import { CSS } from "@dnd-kit/utilities";
13
+ import { DataTypes } from "@etsoo/shared";
14
+ import React, { CSSProperties } from "react";
15
15
 
16
16
  function SortableItem(props: {
17
- id: UniqueIdentifier;
18
- itemRenderer: (
19
- nodeRef: React.ComponentProps<any>,
20
- actionNodeRef: React.ComponentProps<any>
21
- ) => React.ReactElement;
22
- style?: React.CSSProperties;
17
+ id: UniqueIdentifier;
18
+ itemRenderer: (
19
+ nodeRef: React.ComponentProps<any>,
20
+ actionNodeRef: React.ComponentProps<any>
21
+ ) => React.ReactElement;
22
+ style?: React.CSSProperties;
23
23
  }) {
24
- // Destruct
25
- const { id, itemRenderer, style = {} } = props;
26
-
27
- // Use sortable
28
- const {
29
- attributes,
30
- listeners,
31
- setNodeRef,
32
- transform,
33
- transition,
34
- setActivatorNodeRef
35
- } = useSortable({ id });
36
-
37
- const allStyle = {
38
- ...style,
39
- transform: CSS.Transform.toString(transform),
40
- transition
41
- };
42
-
43
- const nodeRef = {
44
- style: allStyle,
45
- ref: setNodeRef,
46
- ...attributes
47
- };
48
-
49
- const actionNodeRef = {
50
- ...listeners,
51
- ref: setActivatorNodeRef
52
- };
53
-
54
- return itemRenderer(nodeRef, actionNodeRef);
24
+ // Destruct
25
+ const { id, itemRenderer, style = {} } = props;
26
+
27
+ // Use sortable
28
+ const {
29
+ attributes,
30
+ listeners,
31
+ setNodeRef,
32
+ transform,
33
+ transition,
34
+ setActivatorNodeRef
35
+ } = useSortable({ id });
36
+
37
+ const allStyle = {
38
+ ...style,
39
+ transform: CSS.Transform.toString(transform),
40
+ transition
41
+ };
42
+
43
+ const nodeRef = {
44
+ style: allStyle,
45
+ ref: setNodeRef,
46
+ ...attributes
47
+ };
48
+
49
+ const actionNodeRef = {
50
+ ...listeners,
51
+ ref: setActivatorNodeRef
52
+ };
53
+
54
+ return itemRenderer(nodeRef, actionNodeRef);
55
55
  }
56
56
 
57
57
  /**
58
58
  * DnD list forward ref
59
59
  */
60
60
  export interface DnDListRef<D extends object> {
61
- /**
62
- * Add item
63
- * @param item New item
64
- */
65
- addItem(item: D): void;
66
-
67
- /**
68
- * Add items
69
- * @param items items
70
- */
71
- addItems(items: D[]): void;
72
-
73
- /**
74
- * Delete item
75
- * @param index Item index
76
- */
77
- deleteItem(index: number): void;
78
-
79
- /**
80
- * Edit item
81
- * @param newItem New item
82
- * @param index Index
83
- */
84
- editItem(newItem: D, index: number): boolean;
61
+ /**
62
+ * Add item
63
+ * @param item New item
64
+ */
65
+ addItem(item: D): void;
66
+
67
+ /**
68
+ * Add items
69
+ * @param items items
70
+ */
71
+ addItems(items: D[]): void;
72
+
73
+ /**
74
+ * Delete item
75
+ * @param index Item index
76
+ */
77
+ deleteItem(index: number): void;
78
+
79
+ /**
80
+ * Edit item
81
+ * @param newItem New item
82
+ * @param index Index
83
+ */
84
+ editItem(newItem: D, index: number): boolean;
85
85
  }
86
86
 
87
87
  /**
88
88
  * DnD sortable list properties
89
89
  */
90
90
  export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
91
- /**
92
- * Get list item style callback
93
- */
94
- getItemStyle: (index: number, isDragging: boolean) => CSSProperties;
95
-
96
- /**
97
- * Item renderer
98
- */
99
- itemRenderer: (
100
- item: D,
101
- index: number,
102
- nodeRef: React.ComponentProps<any>,
103
- actionNodeRef: React.ComponentProps<any>
104
- ) => React.ReactElement;
105
-
106
- /**
107
- * List items
108
- */
109
- items: D[];
110
-
111
- /**
112
- * Unique key field
113
- */
114
- keyField: K;
115
-
116
- /**
117
- * Label field
118
- */
119
- labelField: K;
120
-
121
- /**
122
- * Methods ref
123
- */
124
- mRef?: React.Ref<DnDListRef<D>>;
125
-
126
- /**
127
- * Data change handler
128
- */
129
- onChange?: (items: D[]) => void;
130
-
131
- /**
132
- * Drag end handler
133
- */
134
- onDragEnd?: (items: D[]) => void;
91
+ /**
92
+ * Get list item style callback
93
+ */
94
+ getItemStyle: (index: number, isDragging: boolean) => CSSProperties;
95
+
96
+ /**
97
+ * Item renderer
98
+ */
99
+ itemRenderer: (
100
+ item: D,
101
+ index: number,
102
+ nodeRef: React.ComponentProps<any>,
103
+ actionNodeRef: React.ComponentProps<any>
104
+ ) => React.ReactElement;
105
+
106
+ /**
107
+ * List items
108
+ */
109
+ items: D[];
110
+
111
+ /**
112
+ * Unique key field
113
+ */
114
+ keyField: K;
115
+
116
+ /**
117
+ * Label field
118
+ */
119
+ labelField: K;
120
+
121
+ /**
122
+ * Methods ref
123
+ */
124
+ mRef?: React.Ref<DnDListRef<D>>;
125
+
126
+ /**
127
+ * Data change handler
128
+ */
129
+ onChange?: (items: D[]) => void;
130
+
131
+ /**
132
+ * Drag end handler
133
+ */
134
+ onDragEnd?: (items: D[]) => void;
135
135
  }
136
136
 
137
137
  /**
@@ -140,182 +140,167 @@ export interface DnDListPros<D extends object, K extends DataTypes.Keys<D>> {
140
140
  * @returns Component
141
141
  */
142
142
  export function DnDList<
143
- D extends { id: UniqueIdentifier },
144
- K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<
145
- D,
146
- UniqueIdentifier
147
- >
143
+ D extends { id: UniqueIdentifier },
144
+ K extends DataTypes.Keys<D, UniqueIdentifier> = DataTypes.Keys<
145
+ D,
146
+ UniqueIdentifier
147
+ >
148
148
  >(props: DnDListPros<D, K>) {
149
- // Destruct
150
- const {
151
- getItemStyle,
152
- keyField,
153
- itemRenderer,
154
- labelField,
155
- mRef,
156
- onChange,
157
- onDragEnd
158
- } = props;
159
-
160
- // States
161
- const [items, setItems] = React.useState<D[]>([]);
162
- const [activeId, setActiveId] = React.useState<UniqueIdentifier>();
163
-
164
- const changeItems = (newItems: D[]) => {
165
- // Possible to alter items with the handler
166
- if (onChange) onChange(newItems);
167
-
168
- // Update state
169
- setItems(newItems);
170
- };
171
-
172
- // Drag event handlers
173
- function handleDragStart(event: DragStartEvent) {
174
- const { active } = event;
175
- setActiveId(active.id);
149
+ // Destruct
150
+ const {
151
+ getItemStyle,
152
+ keyField,
153
+ itemRenderer,
154
+ labelField,
155
+ mRef,
156
+ onChange,
157
+ onDragEnd
158
+ } = props;
159
+
160
+ // States
161
+ const [items, setItems] = React.useState<D[]>([]);
162
+ const [activeId, setActiveId] = React.useState<UniqueIdentifier>();
163
+
164
+ const changeItems = (newItems: D[]) => {
165
+ // Possible to alter items with the handler
166
+ if (onChange) onChange(newItems);
167
+
168
+ // Update state
169
+ setItems(newItems);
170
+ };
171
+
172
+ // Drag event handlers
173
+ function handleDragStart(event: DragStartEvent) {
174
+ const { active } = event;
175
+ setActiveId(active.id);
176
+ }
177
+
178
+ function handleDragEnd(event: DragEndEvent) {
179
+ const { active, over } = event;
180
+
181
+ if (over && active.id !== over.id) {
182
+ // Indices
183
+ const oldIndex = items.findIndex((item) => item.id === active.id);
184
+ const newIndex = items.findIndex((item) => item.id === over.id);
185
+
186
+ // Clone
187
+ const newItems = [...items];
188
+
189
+ // Removed item
190
+ const [removed] = newItems.splice(oldIndex, 1);
191
+
192
+ // Insert to the destination index
193
+ newItems.splice(newIndex, 0, removed);
194
+
195
+ changeItems(newItems);
196
+
197
+ // Drag end handler
198
+ if (onDragEnd) onDragEnd(newItems);
176
199
  }
177
200
 
178
- function handleDragEnd(event: DragEndEvent) {
179
- const { active, over } = event;
201
+ setActiveId(undefined);
202
+ }
180
203
 
181
- if (over && active.id !== over.id) {
182
- // Indices
183
- const oldIndex = items.findIndex((item) => item.id === active.id);
184
- const newIndex = items.findIndex((item) => item.id === over.id);
204
+ // Methods
205
+ React.useImperativeHandle(
206
+ mRef,
207
+ () => {
208
+ return {
209
+ addItem(newItem: D) {
210
+ // Existence check
211
+ if (items.some((item) => item[labelField] === newItem[labelField])) {
212
+ return false;
213
+ }
185
214
 
186
- // Clone
187
- const newItems = [...items];
215
+ // Clone
216
+ const newItems = [newItem, ...items];
188
217
 
189
- // Removed item
190
- const [removed] = newItems.splice(oldIndex, 1);
218
+ // Update the state
219
+ changeItems(newItems);
191
220
 
192
- // Insert to the destination index
193
- newItems.splice(newIndex, 0, removed);
221
+ return true;
222
+ },
194
223
 
195
- changeItems(newItems);
224
+ addItems(inputItems: D[]) {
225
+ // Clone
226
+ const newItems = [...items];
196
227
 
197
- // Drag end handler
198
- if (onDragEnd) onDragEnd(newItems);
199
- }
228
+ // Insert items
229
+ inputItems.forEach((newItem) => {
230
+ // Existence check
231
+ if (
232
+ newItems.some((item) => item[labelField] === newItem[labelField])
233
+ ) {
234
+ return;
235
+ }
200
236
 
201
- setActiveId(undefined);
202
- }
237
+ newItems.push(newItem);
238
+ });
239
+
240
+ // Update the state
241
+ changeItems(newItems);
242
+
243
+ return newItems.length - items.length;
244
+ },
203
245
 
204
- // Methods
205
- React.useImperativeHandle(
206
- mRef,
207
- () => {
208
- return {
209
- addItem(newItem: D) {
210
- // Existence check
211
- if (
212
- items.some(
213
- (item) => item[labelField] === newItem[labelField]
214
- )
215
- ) {
216
- return false;
217
- }
218
-
219
- // Clone
220
- const newItems = [newItem, ...items];
221
-
222
- // Update the state
223
- changeItems(newItems);
224
-
225
- return true;
226
- },
227
-
228
- addItems(inputItems: D[]) {
229
- // Clone
230
- const newItems = [...items];
231
-
232
- // Insert items
233
- inputItems.forEach((newItem) => {
234
- // Existence check
235
- if (
236
- newItems.some(
237
- (item) =>
238
- item[labelField] === newItem[labelField]
239
- )
240
- ) {
241
- return;
242
- }
243
-
244
- newItems.push(newItem);
245
- });
246
-
247
- // Update the state
248
- changeItems(newItems);
249
-
250
- return newItems.length - items.length;
251
- },
252
-
253
- editItem(newItem: D, index: number) {
254
- // Existence check
255
- const newIndex = items.findIndex(
256
- (item) => item[labelField] === newItem[labelField]
257
- );
258
- if (newIndex >= 0 && newIndex !== index) {
259
- // Label field is the same with a different item
260
- return false;
261
- }
262
-
263
- // Clone
264
- const newItems = [...items];
265
-
266
- // Remove the item
267
- newItems.splice(index, 1, newItem);
268
-
269
- // Update the state
270
- changeItems(newItems);
271
-
272
- return true;
273
- },
274
-
275
- deleteItem(index: number) {
276
- // Clone
277
- const newItems = [...items];
278
-
279
- // Remove the item
280
- newItems.splice(index, 1);
281
-
282
- // Update the state
283
- changeItems(newItems);
284
- }
285
- };
246
+ editItem(newItem: D, index: number) {
247
+ // Existence check
248
+ const newIndex = items.findIndex(
249
+ (item) => item[labelField] === newItem[labelField]
250
+ );
251
+ if (newIndex >= 0 && newIndex !== index) {
252
+ // Label field is the same with a different item
253
+ return false;
254
+ }
255
+
256
+ // Clone
257
+ const newItems = [...items];
258
+
259
+ // Remove the item
260
+ newItems.splice(index, 1, newItem);
261
+
262
+ // Update the state
263
+ changeItems(newItems);
264
+
265
+ return true;
286
266
  },
287
- [items]
288
- );
289
-
290
- React.useEffect(() => {
291
- setItems(props.items);
292
- }, [props.items]);
293
-
294
- return (
295
- <DndContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
296
- <SortableContext
297
- items={items}
298
- strategy={verticalListSortingStrategy}
299
- >
300
- {items.map((item, index) => {
301
- const id = item[keyField] as unknown as UniqueIdentifier;
302
- return (
303
- <SortableItem
304
- id={id}
305
- key={id}
306
- style={getItemStyle(index, id === activeId)}
307
- itemRenderer={(nodeRef, actionNodeRef) =>
308
- itemRenderer(
309
- item,
310
- index,
311
- nodeRef,
312
- actionNodeRef
313
- )
314
- }
315
- />
316
- );
317
- })}
318
- </SortableContext>
319
- </DndContext>
320
- );
267
+
268
+ deleteItem(index: number) {
269
+ // Clone
270
+ const newItems = [...items];
271
+
272
+ // Remove the item
273
+ newItems.splice(index, 1);
274
+
275
+ // Update the state
276
+ changeItems(newItems);
277
+ }
278
+ };
279
+ },
280
+ [items]
281
+ );
282
+
283
+ React.useEffect(() => {
284
+ setItems(props.items);
285
+ }, [props.items]);
286
+
287
+ return (
288
+ <DndContext onDragStart={handleDragStart} onDragEnd={handleDragEnd}>
289
+ <SortableContext items={items} strategy={verticalListSortingStrategy}>
290
+ {items.map((item, index) => {
291
+ const id = item[keyField] as unknown as UniqueIdentifier;
292
+ return (
293
+ <SortableItem
294
+ id={id}
295
+ key={id}
296
+ style={getItemStyle(index, id === activeId)}
297
+ itemRenderer={(nodeRef, actionNodeRef) =>
298
+ itemRenderer(item, index, nodeRef, actionNodeRef)
299
+ }
300
+ />
301
+ );
302
+ })}
303
+ </SortableContext>
304
+ </DndContext>
305
+ );
321
306
  }
@@ -1,26 +1,26 @@
1
- import { BridgeUtils, IBridgeHost } from '@etsoo/appscript';
2
- import React from 'react';
1
+ import { BridgeUtils, IBridgeHost } from "@etsoo/appscript";
2
+ import React from "react";
3
3
  import {
4
- BrowserRouter,
5
- createBrowserRouter,
6
- createMemoryRouter,
7
- MemoryRouter,
8
- RouteObject
9
- } from 'react-router-dom';
4
+ BrowserRouter,
5
+ createBrowserRouter,
6
+ createMemoryRouter,
7
+ MemoryRouter,
8
+ RouteObject
9
+ } from "react-router-dom";
10
10
 
11
11
  /**
12
12
  * Dynamic router props
13
13
  */
14
14
  export type DynamicRouterProps = {
15
- /**
16
- * basename of the router
17
- */
18
- basename?: string;
15
+ /**
16
+ * basename of the router
17
+ */
18
+ basename?: string;
19
19
  };
20
20
 
21
21
  function getEntries(host: IBridgeHost) {
22
- const startUrl = host.getStartUrl();
23
- return startUrl == null ? undefined : [startUrl];
22
+ const startUrl = host.getStartUrl();
23
+ return startUrl == null ? undefined : [startUrl];
24
24
  }
25
25
 
26
26
  /**
@@ -29,20 +29,20 @@ function getEntries(host: IBridgeHost) {
29
29
  * @returns Component
30
30
  */
31
31
  export function DynamicRouter(
32
- props: React.PropsWithChildren<DynamicRouterProps>
32
+ props: React.PropsWithChildren<DynamicRouterProps>
33
33
  ) {
34
- // Destruct
35
- const { basename, children } = props;
34
+ // Destruct
35
+ const { basename, children } = props;
36
36
 
37
- // Layout
38
- const host = BridgeUtils.host;
39
- return host == null ? (
40
- <BrowserRouter basename={basename}>{children}</BrowserRouter>
41
- ) : (
42
- <MemoryRouter basename={basename} initialEntries={getEntries(host)}>
43
- {children}
44
- </MemoryRouter>
45
- );
37
+ // Layout
38
+ const host = BridgeUtils.host;
39
+ return host == null ? (
40
+ <BrowserRouter basename={basename}>{children}</BrowserRouter>
41
+ ) : (
42
+ <MemoryRouter basename={basename} initialEntries={getEntries(host)}>
43
+ {children}
44
+ </MemoryRouter>
45
+ );
46
46
  }
47
47
 
48
48
  /**
@@ -52,14 +52,14 @@ export function DynamicRouter(
52
52
  * @returns Router
53
53
  */
54
54
  export function createDynamicRouter(
55
- routes: RouteObject[],
56
- opts?: DynamicRouterProps
55
+ routes: RouteObject[],
56
+ opts?: DynamicRouterProps
57
57
  ) {
58
- // Is host?
59
- const host = BridgeUtils.host;
60
- if (host == null) {
61
- return createBrowserRouter(routes, opts);
62
- } else {
63
- return createMemoryRouter(routes, opts);
64
- }
58
+ // Is host?
59
+ const host = BridgeUtils.host;
60
+ if (host == null) {
61
+ return createBrowserRouter(routes, opts);
62
+ } else {
63
+ return createMemoryRouter(routes, opts);
64
+ }
65
65
  }