@umijs/renderer-react 4.0.8 → 4.0.9
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/appContext.d.ts +0 -0
- package/dist/appContext.js +0 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/link.d.ts +0 -0
- package/dist/link.js +0 -0
- package/dist/routeContext.d.ts +0 -0
- package/dist/routeContext.js +0 -0
- package/dist/routes.d.ts +0 -0
- package/dist/routes.js +3 -1
- package/dist/server.d.ts +0 -0
- package/dist/server.js +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +0 -0
- package/dist/useFetcher.d.ts +0 -0
- package/dist/useFetcher.js +0 -0
- package/dist/withRouter.d.ts +0 -0
- package/dist/withRouter.js +0 -0
- package/package.json +4 -4
package/dist/appContext.d.ts
CHANGED
|
File without changes
|
package/dist/appContext.js
CHANGED
|
File without changes
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { History } from 'history';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom/client';
|
|
3
4
|
import { IRouteComponents, IRoutesById } from './types';
|
|
5
|
+
export declare function __getRoot(): ReactDOM.Root | null;
|
|
4
6
|
export declare function Routes(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
5
7
|
export declare function renderClient(opts: {
|
|
6
8
|
publicPath?: string;
|
package/dist/browser.js
CHANGED
|
@@ -8,6 +8,11 @@ import { matchRoutes, Router, useRoutes } from 'react-router-dom';
|
|
|
8
8
|
import { AppContext, useAppData } from "./appContext";
|
|
9
9
|
import { createClientRoutes } from "./routes";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var root = null; // react 18 some scenarios need unmount such as micro app
|
|
12
|
+
|
|
13
|
+
export function __getRoot() {
|
|
14
|
+
return root;
|
|
15
|
+
}
|
|
11
16
|
|
|
12
17
|
function BrowserRoutes(props) {
|
|
13
18
|
var history = props.history;
|
|
@@ -211,7 +216,8 @@ export function renderClient(opts) {
|
|
|
211
216
|
ReactDOM.hydrateRoot(rootElement, /*#__PURE__*/_jsx(Browser, {}));
|
|
212
217
|
} else {
|
|
213
218
|
if (ReactDOM.createRoot) {
|
|
214
|
-
ReactDOM.createRoot(rootElement)
|
|
219
|
+
root = ReactDOM.createRoot(rootElement);
|
|
220
|
+
root.render( /*#__PURE__*/_jsx(Browser, {}));
|
|
215
221
|
} else {
|
|
216
222
|
// @ts-ignore
|
|
217
223
|
ReactDOM.render( /*#__PURE__*/_jsx(Browser, {}), rootElement);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createBrowserHistory, createHashHistory, createMemoryHistory, type History, } from 'history';
|
|
2
2
|
export { createSearchParams, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams, } from 'react-router-dom';
|
|
3
3
|
export { useAppData, useClientLoaderData, useServerLoaderData, } from './appContext';
|
|
4
|
-
export { renderClient } from './browser';
|
|
4
|
+
export { renderClient, __getRoot } from './browser';
|
|
5
5
|
export { LinkWithPrefetch as Link } from './link';
|
|
6
6
|
export { useRouteData } from './routeContext';
|
|
7
7
|
export { __useFetcher } from './useFetcher';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createBrowserHistory, createHashHistory, createMemoryHistory } from 'history';
|
|
2
2
|
export { createSearchParams, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams } from 'react-router-dom';
|
|
3
3
|
export { useAppData, useClientLoaderData, useServerLoaderData } from "./appContext";
|
|
4
|
-
export { renderClient } from "./browser";
|
|
4
|
+
export { renderClient, __getRoot } from "./browser";
|
|
5
5
|
export { LinkWithPrefetch as Link } from "./link";
|
|
6
6
|
export { useRouteData } from "./routeContext";
|
|
7
7
|
export { __useFetcher } from "./useFetcher";
|
package/dist/link.d.ts
CHANGED
|
File without changes
|
package/dist/link.js
CHANGED
|
File without changes
|
package/dist/routeContext.d.ts
CHANGED
|
File without changes
|
package/dist/routeContext.js
CHANGED
|
File without changes
|
package/dist/routes.d.ts
CHANGED
|
File without changes
|
package/dist/routes.js
CHANGED
|
@@ -43,7 +43,9 @@ function NavigateWithParams(props) {
|
|
|
43
43
|
to: generatePath(props.to, params)
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
return /*#__PURE__*/_jsx(Navigate, _objectSpread({
|
|
46
|
+
return /*#__PURE__*/_jsx(Navigate, _objectSpread({
|
|
47
|
+
replace: true
|
|
48
|
+
}, propsWithParams));
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
function createClientRoute(opts) {
|
package/dist/server.d.ts
CHANGED
|
File without changes
|
package/dist/server.js
CHANGED
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
File without changes
|
package/dist/types.js
CHANGED
|
File without changes
|
package/dist/useFetcher.d.ts
CHANGED
|
File without changes
|
package/dist/useFetcher.js
CHANGED
|
File without changes
|
package/dist/withRouter.d.ts
CHANGED
|
File without changes
|
package/dist/withRouter.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-react",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"description": "@umijs/renderer-react",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "umi-scripts father build",
|
|
20
20
|
"build:deps": "umi-scripts bundleDeps",
|
|
21
|
-
"dev": "
|
|
21
|
+
"dev": "umi-scripts father dev",
|
|
22
22
|
"test": "umi-scripts jest-turbo"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@babel/runtime": "7.
|
|
25
|
+
"@babel/runtime": "7.18.9",
|
|
26
26
|
"@loadable/component": "5.15.2",
|
|
27
27
|
"history": "5.3.0",
|
|
28
28
|
"react-router-dom": "6.3.0"
|