@alicloud/alfa-react 2.0.3-alpha.4 → 2.0.3

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.
@@ -84,6 +84,7 @@ export default function createApplication(loader) {
84
84
  preLoader: preLoader,
85
85
  container: container
86
86
  });
87
+ var mountedApp = useRef(false);
87
88
  var onSyncHistory = useCallbackRef(props.onSyncHistory || function () {});
88
89
  $syncHistory.current = syncHistory;
89
90
  $basename.current = basename;
@@ -388,6 +389,10 @@ export default function createApplication(loader) {
388
389
  var _appInstance$context$;
389
390
  if (isUnmounted) return;
390
391
 
392
+ // 保持 path 的路由同步,请勿删除
393
+ appInstance.update(customProps);
394
+ mountedApp.current = true;
395
+
391
396
  // 每次挂载后检查是否还有 lazyload 组件未加载
392
397
  setTimeout(function () {
393
398
  forceCheck();
@@ -406,9 +411,10 @@ export default function createApplication(loader) {
406
411
  return function () {
407
412
  isUnmounted = true;
408
413
  appInstance.unmount();
414
+ mountedApp.current = false;
409
415
  };
410
416
  }, [appInstance, getFakeBody]);
411
- if (appInstance) {
417
+ if (appInstance && mountedApp.current) {
412
418
  appInstance.update(customProps);
413
419
  }
414
420
  var dataAttrs = {
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '2.0.3-alpha.4';
1
+ export var version = '2.0.3';
@@ -94,6 +94,7 @@ function createApplication(loader) {
94
94
  preLoader: preLoader,
95
95
  container: container
96
96
  });
97
+ var mountedApp = (0, _react.useRef)(false);
97
98
  var onSyncHistory = (0, _hooks.useCallbackRef)(props.onSyncHistory || function () {});
98
99
  $syncHistory.current = syncHistory;
99
100
  $basename.current = basename;
@@ -398,6 +399,10 @@ function createApplication(loader) {
398
399
  var _appInstance$context$;
399
400
  if (isUnmounted) return;
400
401
 
402
+ // 保持 path 的路由同步,请勿删除
403
+ appInstance.update(customProps);
404
+ mountedApp.current = true;
405
+
401
406
  // 每次挂载后检查是否还有 lazyload 组件未加载
402
407
  setTimeout(function () {
403
408
  (0, _reactLazyload.forceCheck)();
@@ -416,9 +421,10 @@ function createApplication(loader) {
416
421
  return function () {
417
422
  isUnmounted = true;
418
423
  appInstance.unmount();
424
+ mountedApp.current = false;
419
425
  };
420
426
  }, [appInstance, getFakeBody]);
421
- if (appInstance) {
427
+ if (appInstance && mountedApp.current) {
422
428
  appInstance.update(customProps);
423
429
  }
424
430
  var dataAttrs = {
package/lib/version.js CHANGED
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = exports.version = '2.0.3-alpha.4';
7
+ var version = exports.version = '2.0.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/alfa-react",
3
- "version": "2.0.3-alpha.4",
3
+ "version": "2.0.3",
4
4
  "description": "Alfa Framework (React Version)",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -52,7 +52,7 @@
52
52
  "lodash-es": "^4.17.21",
53
53
  "prop-types": "^15.8.1",
54
54
  "react-lazyload": "^3.2.1",
55
- "@alicloud/alfa-core": "^1.5.6-alpha.1",
55
+ "@alicloud/alfa-core": "^1.5.6",
56
56
  "@alicloud/console-os-loader": "^1.4.45-alpha.1"
57
57
  },
58
58
  "peerDependencies": {
@@ -1 +1 @@
1
- export declare const version = "2.0.3-alpha.4";
1
+ export declare const version = "2.0.3";