@umijs/renderer-react
Advanced tools
Comparing version 4.0.0-canary.20240903.3 to 4.0.0-canary.20240909.1
@@ -20,3 +20,3 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime"; | ||
case 0: | ||
basename = '/'; | ||
basename = opts.basename || '/'; | ||
components = _objectSpread({}, opts.routeComponents); // todo 参数对齐 | ||
@@ -34,3 +34,9 @@ clientRoutes = createClientRoutes({ | ||
}); | ||
rootContainer = /*#__PURE__*/React.createElement(StaticRouter, { | ||
rootContainer = | ||
/*#__PURE__*/ | ||
// 这里的 location 需要包含 basename, 否则会影响 StaticRouter 的匹配. | ||
// 由于 getClientRootComponent 方法会同时用于 ssr 和 ssg, 所以在调用该方法时需要注意传入的 location 是否包含 basename. | ||
// 1. 在用于 ssr 时传入的 location 来源于 request.url, 它是包含 basename 的, 所以没有问题. | ||
// 2. 但是在用于 ssg 时(static export), 需要注意传入的 locaiton 要拼接上 basename. | ||
React.createElement(StaticRouter, { | ||
basename: basename, | ||
@@ -37,0 +43,0 @@ location: opts.location |
@@ -67,2 +67,3 @@ /// <reference types="react" /> | ||
manifest: any; | ||
basename?: string; | ||
} | ||
@@ -69,0 +70,0 @@ export interface IHtmlProps extends IHtmlHydrateOptions { |
{ | ||
"name": "@umijs/renderer-react", | ||
"version": "4.0.0-canary.20240903.3", | ||
"version": "4.0.0-canary.20240909.1", | ||
"description": "@umijs/renderer-react", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46054
1095