@momo-kits/foundation 0.165.1-beta.4 → 0.165.1-beta.5

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.
@@ -233,18 +233,17 @@ const BottomTab: React.FC<BottomTabProps> = ({
233
233
  });
234
234
  }, [itemWidth, indicatorAnimated]);
235
235
 
236
- // TEMP: commented out to test whether the blur reset is needed on a real host.
237
- // Without it, pushing a screen from a tab other than the first leaves the flag true, so that
238
- // pushed screen gets the host floating-arrow instead of its own card swipe-back.
239
- // useFocusEffect(
240
- // React.useCallback(() => {
241
- // NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(
242
- // activeIndex.current !== 0,
243
- // );
244
- // return () =>
245
- // NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(false);
246
- // }, []),
247
- // );
236
+ // Focus, not mount: pushing a screen from a tab leaves BottomTab mounted but blurred, and
237
+ // onFocus only fires on tab changes.
238
+ useFocusEffect(
239
+ React.useCallback(() => {
240
+ NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(
241
+ activeIndex.current !== 0,
242
+ );
243
+ return () =>
244
+ NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(false);
245
+ }, []),
246
+ );
248
247
 
249
248
  const onFocus = (e: any) => {
250
249
  activeIndex.current = tabs.findIndex(i => e.target.includes(i.name));
@@ -253,10 +252,11 @@ const BottomTab: React.FC<BottomTabProps> = ({
253
252
  });
254
253
 
255
254
  const isFirstTab = activeIndex.current === 0;
255
+ const gestureEnabled = Platform.OS === 'ios' && isFirstTab;
256
256
  navigation?.setOptions({
257
- gestureEnabled: Platform.OS === 'ios' && isFirstTab,
257
+ gestureEnabled: gestureEnabled,
258
258
  });
259
- NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(!isFirstTab);
259
+ NativeModules?.MiniAppModule?.setShouldUseFloatingArrowBack?.(!gestureEnabled);
260
260
  };
261
261
 
262
262
  const handler: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.165.1-beta.4",
3
+ "version": "0.165.1-beta.5",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},