@umijs/renderer-react 4.0.0-beta.14 → 4.0.0-beta.15
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 +14 -2
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -16,6 +16,18 @@ function BrowserRoutes(props) {
|
|
|
16
16
|
location: history.location,
|
|
17
17
|
});
|
|
18
18
|
React.useLayoutEffect(() => history.listen(setState), [history]);
|
|
19
|
+
React.useLayoutEffect(() => history.listen((location, action) => {
|
|
20
|
+
props.pluginManager.applyPlugins({
|
|
21
|
+
key: 'onRouteChange',
|
|
22
|
+
type: 'event',
|
|
23
|
+
args: {
|
|
24
|
+
routes: props.routes,
|
|
25
|
+
clientRoutes: props.clientRoutes,
|
|
26
|
+
location,
|
|
27
|
+
action,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}), [history, props.routes, props.clientRoutes]);
|
|
19
31
|
return (React.createElement(Router, { navigator: history, location: state.location, basename: props.basename }, props.children));
|
|
20
32
|
}
|
|
21
33
|
function Routes() {
|
|
@@ -29,15 +41,15 @@ export function renderClient(opts) {
|
|
|
29
41
|
routesById: opts.routes,
|
|
30
42
|
routeComponents: opts.routeComponents,
|
|
31
43
|
});
|
|
32
|
-
let rootContainer = (React.createElement(BrowserRoutes, { basename: basename },
|
|
44
|
+
let rootContainer = (React.createElement(BrowserRoutes, { basename: basename, pluginManager: opts.pluginManager, routes: opts.routes, clientRoutes: clientRoutes },
|
|
33
45
|
React.createElement(Routes, null)));
|
|
34
46
|
for (const key of [
|
|
47
|
+
// Lowest to the highest priority
|
|
35
48
|
'innerProvider',
|
|
36
49
|
'i18nProvider',
|
|
37
50
|
'accessProvider',
|
|
38
51
|
'dataflowProvider',
|
|
39
52
|
'outerProvider',
|
|
40
|
-
// Highest priority
|
|
41
53
|
'rootContainer',
|
|
42
54
|
]) {
|
|
43
55
|
rootContainer = opts.pluginManager.applyPlugins({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-react",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.15",
|
|
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",
|