@umijs/renderer-react 4.0.0-rc.18 → 4.0.0-rc.20
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 +4 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/link.d.ts +3 -10
- package/dist/link.js +1 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -70,9 +70,10 @@ export function renderClient(opts) {
|
|
|
70
70
|
const [clientLoaderData, setClientLoaderData] = useState({});
|
|
71
71
|
const handleRouteChange = useCallback((p) => {
|
|
72
72
|
var _a;
|
|
73
|
-
|
|
73
|
+
// Patched routes has to id
|
|
74
|
+
const matchedRouteIds = (((_a = matchRoutes(clientRoutes, p)) === null || _a === void 0 ? void 0 : _a.map(
|
|
74
75
|
// @ts-ignore
|
|
75
|
-
(route) => route.route.id)) || [];
|
|
76
|
+
(route) => route.route.id)) || []).filter(Boolean);
|
|
76
77
|
matchedRouteIds.forEach((id) => {
|
|
77
78
|
// preload
|
|
78
79
|
// @ts-ignore
|
|
@@ -131,6 +132,6 @@ export function renderClient(opts) {
|
|
|
131
132
|
}
|
|
132
133
|
else {
|
|
133
134
|
// @ts-ignore
|
|
134
|
-
ReactDOM.render(
|
|
135
|
+
ReactDOM.render(React.createElement(Browser, null), rootElement);
|
|
135
136
|
}
|
|
136
137
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createBrowserHistory, createHashHistory, createMemoryHistory, History, } from 'history';
|
|
2
|
-
export { createSearchParams, matchPath, matchRoutes, Navigate, NavLink, Outlet, useLocation, useMatch, useNavigate, useOutlet, useParams, useResolvedPath, useRoutes, useSearchParams, } from 'react-router-dom';
|
|
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 } from './appContext';
|
|
4
4
|
export { renderClient } from './browser';
|
|
5
5
|
export { LinkWithPrefetch as Link } from './link';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createBrowserHistory, createHashHistory, createMemoryHistory, } from 'history';
|
|
2
|
-
export { createSearchParams, matchPath, matchRoutes, Navigate, NavLink, Outlet, useLocation, useMatch, useNavigate, useOutlet, useParams, useResolvedPath, useRoutes, useSearchParams, } from 'react-router-dom';
|
|
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 } from './appContext';
|
|
4
4
|
export { renderClient } from './browser';
|
|
5
5
|
export { LinkWithPrefetch as Link } from './link';
|
package/dist/link.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { LinkProps } from 'react-router-dom';
|
|
2
3
|
export declare function LinkWithPrefetch(props: PropsWithChildren<{
|
|
3
4
|
prefetch?: boolean;
|
|
4
|
-
|
|
5
|
-
pathname: string;
|
|
6
|
-
search: string;
|
|
7
|
-
hash: string;
|
|
8
|
-
}>;
|
|
9
|
-
replace?: boolean;
|
|
10
|
-
state?: boolean;
|
|
11
|
-
reloadDocument?: boolean;
|
|
12
|
-
}>): JSX.Element;
|
|
5
|
+
} & LinkProps & React.RefAttributes<HTMLAnchorElement>>): JSX.Element;
|
package/dist/link.js
CHANGED
|
@@ -4,5 +4,5 @@ import { useAppData } from './appContext';
|
|
|
4
4
|
export function LinkWithPrefetch(props) {
|
|
5
5
|
const appData = useAppData();
|
|
6
6
|
const to = typeof props.to === 'string' ? props.to : props.to.pathname;
|
|
7
|
-
return (React.createElement(Link, { onMouseEnter: () => props.prefetch && appData.preloadRoute(to),
|
|
7
|
+
return (React.createElement(Link, { onMouseEnter: () => props.prefetch && appData.preloadRoute(to), ...props }, props.children));
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-react",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.20",
|
|
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",
|