@etsoo/react 1.5.17 → 1.5.18
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/lib/app/ReactUtils.js +1 -0
- package/lib/mu/BackButton.js +0 -4
- package/package.json +1 -1
- package/src/app/ReactUtils.ts +7 -0
- package/src/mu/BackButton.tsx +0 -6
package/lib/app/ReactUtils.js
CHANGED
|
@@ -41,6 +41,7 @@ export var ReactUtils;
|
|
|
41
41
|
* @returns NavigateFn
|
|
42
42
|
*/
|
|
43
43
|
function getNavigateFn() {
|
|
44
|
+
console.log('getNavigateFn', memoryHistory, memoryHistory === null || memoryHistory === void 0 ? void 0 : memoryHistory.navigate, (memoryHistory === null || memoryHistory === void 0 ? void 0 : memoryHistory.navigate) === navigate);
|
|
44
45
|
if (memoryHistory == null)
|
|
45
46
|
return navigate;
|
|
46
47
|
return memoryHistory.navigate;
|
package/lib/mu/BackButton.js
CHANGED
|
@@ -23,10 +23,6 @@ export function BackButton(props) {
|
|
|
23
23
|
// Navigate
|
|
24
24
|
const navigate = ReactUtils.getNavigateFn();
|
|
25
25
|
await navigate(-1);
|
|
26
|
-
const history = ReactUtils.getMemoryHistory();
|
|
27
|
-
if (history) {
|
|
28
|
-
console.log(history);
|
|
29
|
-
}
|
|
30
26
|
};
|
|
31
27
|
return (React.createElement(IconButton, { "aria-label": "Back", color: color, size: size, onClick: onClickLocal, sx: {
|
|
32
28
|
backgroundColor: pColor.contrastText,
|
package/package.json
CHANGED
package/src/app/ReactUtils.ts
CHANGED
|
@@ -50,6 +50,13 @@ export namespace ReactUtils {
|
|
|
50
50
|
* @returns NavigateFn
|
|
51
51
|
*/
|
|
52
52
|
export function getNavigateFn() {
|
|
53
|
+
console.log(
|
|
54
|
+
'getNavigateFn',
|
|
55
|
+
memoryHistory,
|
|
56
|
+
memoryHistory?.navigate,
|
|
57
|
+
memoryHistory?.navigate === navigate
|
|
58
|
+
);
|
|
59
|
+
|
|
53
60
|
if (memoryHistory == null) return navigate;
|
|
54
61
|
return memoryHistory.navigate;
|
|
55
62
|
}
|
package/src/mu/BackButton.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import { IconButton, IconButtonProps, useTheme } from '@mui/material';
|
|
|
2
2
|
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ReactUtils } from '../app/ReactUtils';
|
|
5
|
-
import { BridgeUtils } from '@etsoo/appscript';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* BackButton props
|
|
@@ -34,11 +33,6 @@ export function BackButton(props: BackButtonProps) {
|
|
|
34
33
|
// Navigate
|
|
35
34
|
const navigate = ReactUtils.getNavigateFn();
|
|
36
35
|
await navigate(-1);
|
|
37
|
-
|
|
38
|
-
const history = ReactUtils.getMemoryHistory();
|
|
39
|
-
if (history) {
|
|
40
|
-
console.log(history);
|
|
41
|
-
}
|
|
42
36
|
};
|
|
43
37
|
|
|
44
38
|
return (
|