@momo-kits/foundation 0.78.2 → 0.78.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.
@@ -117,7 +117,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
117
117
  const mountedRef = useRef(true);
118
118
 
119
119
  let handleOnLayout;
120
- if (useSnap) {
120
+ if (!useSnap) {
121
121
  handleOnLayout = useCallback(
122
122
  ({
123
123
  nativeEvent: {
@@ -1,4 +1,4 @@
1
- import {StackActions} from '@react-navigation/native';
1
+ import {CommonActions, StackActions} from '@react-navigation/native';
2
2
  import {
3
3
  BottomSheetParams,
4
4
  HeaderToolkitProps,
@@ -48,6 +48,21 @@ class Navigator {
48
48
  this.ref.current.dispatch(StackActions.popToTop());
49
49
  };
50
50
 
51
+ reset = (params: ScreenParams) => {
52
+ this.ref.current.dispatch(
53
+ CommonActions.reset({
54
+ index: 0,
55
+ routes: [
56
+ {
57
+ name: 'Stack',
58
+ key: `Stack_${new Date().getTime()}`,
59
+ params,
60
+ },
61
+ ],
62
+ }),
63
+ );
64
+ };
65
+
51
66
  requestApi = (func: any, args: any = [], callback: any) => {
52
67
  if (this.maxApi) {
53
68
  this.maxApi[func]?.(...args, callback);
@@ -56,6 +71,7 @@ class Navigator {
56
71
  instance?.miniAppApi?.dispatch?.(func, ...args, callback);
57
72
  }
58
73
  };
74
+
59
75
  getToolkit = async (): Promise<HeaderToolkitProps | undefined> => {
60
76
  return new Promise(resolve => {
61
77
  if (this.toolkitConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.78.2",
3
+ "version": "0.78.3",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {