@umijs/renderer-react 4.0.0-rc.21 → 4.0.0-rc.24

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/dist/browser.js CHANGED
@@ -75,6 +75,7 @@ export function renderClient(opts) {
75
75
  // @ts-ignore
76
76
  (route) => route.route.id)) || []).filter(Boolean);
77
77
  matchedRouteIds.forEach((id) => {
78
+ var _a;
78
79
  // preload
79
80
  // @ts-ignore
80
81
  const manifest = window.__umi_manifest__;
@@ -102,7 +103,8 @@ export function renderClient(opts) {
102
103
  }
103
104
  }
104
105
  // client loader
105
- const clientLoader = opts.routes[id].clientLoader;
106
+ // onPatchClientRoutes 添加的 route 在 opts.routes 里是不存在的
107
+ const clientLoader = (_a = opts.routes[id]) === null || _a === void 0 ? void 0 : _a.clientLoader;
106
108
  if (clientLoader && !clientLoaderData[id]) {
107
109
  clientLoader().then((data) => {
108
110
  setClientLoaderData((d) => ({ ...d, [id]: data }));
package/dist/routes.js CHANGED
@@ -32,8 +32,6 @@ function createClientRoute(opts) {
32
32
  const { route } = opts;
33
33
  const { redirect, ...props } = route;
34
34
  return {
35
- children: [],
36
- routes: [],
37
35
  element: redirect ? (React.createElement(Navigate, { to: redirect })) : (React.createElement(RouteContext.Provider, { value: {
38
36
  route: opts.route,
39
37
  } },
package/dist/types.d.ts CHANGED
@@ -10,8 +10,8 @@ export interface IRoute {
10
10
  export interface IClientRoute {
11
11
  id: string;
12
12
  element: React.ReactNode;
13
- children: IClientRoute[];
14
- routes: IClientRoute[];
13
+ children?: IClientRoute[];
14
+ routes?: IClientRoute[];
15
15
  path?: string;
16
16
  index?: boolean;
17
17
  parentId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/renderer-react",
3
- "version": "4.0.0-rc.21",
3
+ "version": "4.0.0-rc.24",
4
4
  "description": "@umijs/renderer-react",
5
5
  "homepage": "https://github.com/umijs/umi-next/tree/master/packages/renderer-react#readme",
6
6
  "bugs": "https://github.com/umijs/umi-next/issues",