Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate E/App to use PlatformStackNavigation #49937

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
1408a2d
feat: native-stack (initial changes)
kirillzyusko Oct 11, 2024
cf17480
fix: match previous behavior and close keyboard in chat navigator whe…
kirillzyusko Oct 11, 2024
2f4363c
fix: prettier
kirillzyusko Oct 11, 2024
2d2627a
fix: partially fix CI checks
kirillzyusko Oct 11, 2024
a42c014
fix: eslint
kirillzyusko Oct 11, 2024
e476b1b
fix: removed unused code
kirillzyusko Oct 11, 2024
db5ec12
fix: TS
kirillzyusko Oct 11, 2024
9d30239
fix: rename functions to pass CI
kirillzyusko Oct 11, 2024
df0b5b6
fix: crashes in FlatList on goBack on Android
kirillzyusko Oct 14, 2024
2eddd62
fix: crash when open and close image in chat
kirillzyusko Oct 14, 2024
8f57acc
fix: incorrect merge conflic resolve
kirillzyusko Oct 14, 2024
600088a
fix: not showing up keyboard in ChatFinder screen
kirillzyusko Oct 15, 2024
fb47d6f
fix: iOS un-natural transitions
kirillzyusko Oct 16, 2024
de1eda9
fix: new screen to use new interface
kirillzyusko Oct 16, 2024
a7293da
fix: remove header in FullScreenNavigator
chrispader Oct 6, 2024
5fc7dd7
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 21, 2024
93d37cc
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 22, 2024
64ddf81
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 23, 2024
485fa25
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 24, 2024
1f98e64
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 24, 2024
1356eff
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 24, 2024
a9b8ef3
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 25, 2024
db5a9e3
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 26, 2024
711ae64
remove unused temporary navigator factories
chrispader Oct 26, 2024
853349f
fix: improve naming of (side) modal navigator screen options generators
chrispader Oct 28, 2024
028b62a
fix: further improve naming
chrispader Oct 28, 2024
2516570
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 28, 2024
88ff047
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 30, 2024
1250fc4
fix: background flashing inverse color
chrispader Oct 30, 2024
f6409c4
fix: use correct Navigation theme based on theme
chrispader Oct 30, 2024
6a7b166
remove unused onSubmit prop
chrispader Oct 30, 2024
17a76e3
fix: remove onSubmit prop type
chrispader Oct 30, 2024
4b420a5
fix: modal stack background style
chrispader Oct 30, 2024
2409969
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Oct 30, 2024
756fd60
fix: use `shouldUseNarrowLayout` instead of `isSmallScreenWidth`
chrispader Oct 30, 2024
8538b30
fix: typo
chrispader Oct 31, 2024
00a9c75
fix: unused onSubmit
chrispader Oct 31, 2024
5485e44
add empty line at the end
chrispader Nov 1, 2024
a0404e6
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 4, 2024
eeac6c3
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 7, 2024
88cd73d
fix: prettier
chrispader Nov 7, 2024
d29e08f
fix: Podfile.lock
chrispader Nov 7, 2024
44c238d
fix: remove unused code
chrispader Nov 7, 2024
3640bf2
fix: add `react-native-screens` patch for ios modal unmount flicker
chrispader Nov 7, 2024
e175aff
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 8, 2024
0106161
fix: add RNS patch for android keyboard resizing fix
chrispader Nov 8, 2024
50abafc
fix: description field not automatically focused
chrispader Nov 11, 2024
6437a86
fix: outdated BottomTabBar
chrispader Nov 11, 2024
2210863
fix: improve navigation options file structure
chrispader Nov 11, 2024
55d1eef
fix: fix animation direction and simplify code
chrispader Nov 11, 2024
3e02e4d
fix: use const Presentation values
chrispader Nov 11, 2024
c5004dc
fix: disallow gesture in onboarding modal
chrispader Nov 11, 2024
8e78f30
fix: prevent unnecessary home screen re-mount
chrispader Nov 12, 2024
3f60c7b
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 12, 2024
c88ff39
fix: remove Podfile change
chrispader Nov 12, 2024
a98fcef
fix: remove Podfile.lock change
chrispader Nov 12, 2024
23e9953
remove unused patch
chrispader Nov 12, 2024
df33cef
fix: update Podfile.lock checksum
chrispader Nov 12, 2024
78d3bd5
Merge branch 'feat/edge-to-edge' into @chrispader/use-platform-stack-…
chrispader Nov 12, 2024
f03f765
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 18, 2024
fab9a8b
chore: update pager view patches
chrispader Nov 18, 2024
1c574ac
Revert "Merge branch 'feat/edge-to-edge' into @chrispader/use-platfor…
chrispader Nov 19, 2024
f474be7
docs: add JSDoc comments
chrispader Nov 20, 2024
d0d8539
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 20, 2024
a851cd7
fix: migrate RouteProp in CodesStep component
chrispader Nov 20, 2024
64a302d
chore(deps): update `react-native-pager-view` to 6.5.1
chrispader Nov 20, 2024
863c2f7
chore: update Podfile.lock
chrispader Nov 20, 2024
61cd4cf
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 21, 2024
4cd3c5a
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 22, 2024
2281b02
improve comments
chrispader Nov 23, 2024
106624a
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
chrispader Nov 25, 2024
a5924af
move syncBrowserHistory files
chrispader Nov 25, 2024
a60349c
revert change
chrispader Nov 25, 2024
f7f2557
fix: imports
chrispader Nov 25, 2024
1e36efe
fix: type CentralPaneScreenOptions in AuthScreens
chrispader Nov 25, 2024
c031e8f
fix: initial report not loading on login
chrispader Nov 25, 2024
3ee8c25
fix: simplify code
chrispader Nov 25, 2024
4832dfe
chore: update pods
chrispader Nov 26, 2024
b94528e
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
kirillzyusko Nov 28, 2024
fe01894
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
kirillzyusko Nov 28, 2024
e19f126
fix: StackScreenProps -> PlatformStackScreenProps
kirillzyusko Nov 28, 2024
b8a3ae0
Merge branch 'main' into @chrispader/use-platform-stack-navigation-in…
kirillzyusko Nov 29, 2024
05773fe
refactor: StackScreenProps -> PlatformStackScreenProps
kirillzyusko Nov 29, 2024
85c0dd7
fix: eslint/prettier
kirillzyusko Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-pager-view (6.5.0):
- react-native-pager-view (6.5.1):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1779,7 +1779,7 @@ PODS:
- React-featureflags
- React-graphics
- React-ImageManager
- react-native-pager-view/common (= 6.5.0)
- react-native-pager-view/common (= 6.5.1)
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
Expand All @@ -1788,7 +1788,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-pager-view/common (6.5.0):
- react-native-pager-view/common (6.5.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -3224,7 +3224,7 @@ SPEC CHECKSUMS:
react-native-keyboard-controller: 97bb7b48fa427c7455afdc8870c2978efd9bfa3a
react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d
react-native-netinfo: fb5112b1fa754975485884ae85a3fb6a684f49d5
react-native-pager-view: c64a744211a46202619a77509f802765d1659dba
react-native-pager-view: abc5ef92699233eb726442c7f452cac82f73d0cb
react-native-pdf: dd6ae39a93607a80919bef9f3499e840c693989d
react-native-performance: 3c608307be10964f8a97d3af462f37125b6d8fa5
react-native-plaid-link-sdk: f91a22b45b7c3d4cd6c47273200dc57df35068b0
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "2.0.82",
"react-native-pager-view": "6.5.0",
"react-native-pager-view": "6.5.1",
"react-native-pdf": "6.7.3",
"react-native-performance": "^5.1.0",
"react-native-permissions": "^3.10.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt
index 9d08d39..146b9c2 100644
--- a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt
+++ b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/Screen.kt
@@ -18,6 +18,7 @@ import com.facebook.react.uimanager.PixelUtil
import com.facebook.react.uimanager.UIManagerHelper
import com.facebook.react.uimanager.UIManagerModule
import com.swmansion.rnscreens.events.HeaderHeightChangeEvent
+import com.swmansion.rnscreens.ext.isInsideScrollViewWithRemoveClippedSubviews

@SuppressLint("ViewConstructor") // Only we construct this view, it is never inflated.
class Screen(
@@ -310,6 +311,16 @@ class Screen(
startTransitionRecursive(child.toolbar)
}
if (child is ViewGroup) {
+ // a combination of https://github.com/software-mansion/react-native-screens/pull/2307/files and https://github.com/software-mansion/react-native-screens/pull/2383/files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch can be removed if we switch to RNS 4.0

+ // The children are miscounted when there's a FlatList with
+ // removeClippedSubviews set to true (default).
+ // We add a simple view for each item in the list to make it work as expected.
+ // See https://github.com/software-mansion/react-native-screens/issues/2282
+ if (child.isInsideScrollViewWithRemoveClippedSubviews()) {
+ for (j in 0 until child.childCount) {
+ child.addView(View(context))
+ }
+ }
startTransitionRecursive(child)
}
}
diff --git a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ext/ViewExt.kt b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ext/ViewExt.kt
new file mode 100644
index 0000000..9d9fbfd
--- /dev/null
+++ b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ext/ViewExt.kt
@@ -0,0 +1,21 @@
+package com.swmansion.rnscreens.ext
+
+import android.view.View
+import android.view.ViewGroup
+import com.facebook.react.views.scroll.ReactHorizontalScrollView
+import com.facebook.react.views.scroll.ReactScrollView
+import com.swmansion.rnscreens.ScreenStack
+
+internal fun View.isInsideScrollViewWithRemoveClippedSubviews(): Boolean {
+ if (this is ReactHorizontalScrollView || this is ReactScrollView) {
+ return false
+ }
+ var parentView = this.parent
+ while (parentView is ViewGroup && parentView !is ScreenStack) {
+ if (parentView is ReactScrollView) {
+ return parentView.removeClippedSubviews
+ }
+ parentView = parentView.parent
+ }
+ return false
+}
\ No newline at end of file
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
diff --git a/node_modules/react-native-screens/ios/RNSScreenStackAnimator.mm b/node_modules/react-native-screens/ios/RNSScreenStackAnimator.mm
index abb2cf6..fb81d52 100644
--- a/node_modules/react-native-screens/ios/RNSScreenStackAnimator.mm
+++ b/node_modules/react-native-screens/ios/RNSScreenStackAnimator.mm
@@ -5,13 +5,14 @@

// proportions to default transition duration
static const float RNSSlideOpenTransitionDurationProportion = 1;
-static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.35;
-static const float RNSSlideCloseTransitionDurationProportion = 0.25 / 0.35;
-static const float RNSFadeCloseTransitionDurationProportion = 0.15 / 0.35;
-static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.35;
+static const float RNSFadeOpenTransitionDurationProportion = 0.2 / 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch can be removed if we switch to RNS 4.0

simple_push animation curve transition has been fixed, so this patch is not needed anymore

+static const float RNSSlideCloseTransitionDurationProportion = 0.25 / 0.5;
+static const float RNSFadeCloseTransitionDurationProportion = 0.15 / 0.5;
+static const float RNSFadeCloseDelayTransitionDurationProportion = 0.1 / 0.5;
// same value is used in other projects using similar approach for transistions
// and it looks the most similar to the value used by Apple
static constexpr float RNSShadowViewMaxAlpha = 0.1;
+static const int UIViewAnimationOptionCurveDefaultTransition = 7 << 16;

@implementation RNSScreenStackAnimator {
UINavigationControllerOperation _operation;
@@ -22,7 +23,7 @@ - (instancetype)initWithOperation:(UINavigationControllerOperation)operation
{
if (self = [super init]) {
_operation = operation;
- _transitionDuration = 0.35; // default duration in seconds
+ _transitionDuration = 0.5; // default duration in seconds
}
return self;
}
@@ -129,6 +130,8 @@ - (void)animateSimplePushWithShadowEnabled:(BOOL)shadowEnabled
}

[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:^{
fromViewController.view.transform = leftTransform;
toViewController.view.transform = CGAffineTransformIdentity;
@@ -170,6 +173,8 @@ - (void)animateSimplePushWithShadowEnabled:(BOOL)shadowEnabled

if (!transitionContext.isInteractive) {
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:animationBlock
completion:completionBlock];
} else {
@@ -203,6 +208,8 @@ - (void)animateSlideFromLeftWithTransitionContext:(id<UIViewControllerContextTra
toViewController.view.transform = rightTransform;
[[transitionContext containerView] addSubview:toViewController.view];
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:^{
fromViewController.view.transform = leftTransform;
toViewController.view.transform = CGAffineTransformIdentity;
@@ -228,6 +235,8 @@ - (void)animateSlideFromLeftWithTransitionContext:(id<UIViewControllerContextTra

if (!transitionContext.isInteractive) {
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:animationBlock
completion:completionBlock];
} else {
@@ -251,6 +260,8 @@ - (void)animateFadeWithTransitionContext:(id<UIViewControllerContextTransitionin
[[transitionContext containerView] addSubview:toViewController.view];
toViewController.view.alpha = 0.0;
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:^{
toViewController.view.alpha = 1.0;
}
@@ -262,6 +273,8 @@ - (void)animateFadeWithTransitionContext:(id<UIViewControllerContextTransitionin
[[transitionContext containerView] insertSubview:toViewController.view belowSubview:fromViewController.view];

[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:^{
fromViewController.view.alpha = 0.0;
}
@@ -284,6 +297,8 @@ - (void)animateSlideFromBottomWithTransitionContext:(id<UIViewControllerContextT
toViewController.view.transform = topBottomTransform;
[[transitionContext containerView] addSubview:toViewController.view];
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:^{
fromViewController.view.transform = CGAffineTransformIdentity;
toViewController.view.transform = CGAffineTransformIdentity;
@@ -309,6 +324,8 @@ - (void)animateSlideFromBottomWithTransitionContext:(id<UIViewControllerContextT

if (!transitionContext.isInteractive) {
[UIView animateWithDuration:[self transitionDuration:transitionContext]
+ delay:0
+ options:UIViewAnimationOptionCurveDefaultTransition
animations:animationBlock
completion:completionBlock];
} else {
diff --git a/node_modules/react-native-screens/lib/typescript/fabric/ModalScreenNativeComponent.d.ts b/node_modules/react-native-screens/lib/typescript/fabric/ModalScreenNativeComponent.d.ts
index 28d6463..a1473e1 100644
--- a/node_modules/react-native-screens/lib/typescript/fabric/ModalScreenNativeComponent.d.ts
+++ b/node_modules/react-native-screens/lib/typescript/fabric/ModalScreenNativeComponent.d.ts
@@ -55,7 +55,7 @@ export interface NativeProps extends ViewProps {
gestureResponseDistance?: GestureResponseDistanceType;
stackPresentation?: WithDefault<StackPresentation, 'push'>;
stackAnimation?: WithDefault<StackAnimation, 'default'>;
- transitionDuration?: WithDefault<Int32, 350>;
+ transitionDuration?: WithDefault<Int32, 500>;
replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean;
diff --git a/node_modules/react-native-screens/lib/typescript/fabric/ScreenNativeComponent.d.ts b/node_modules/react-native-screens/lib/typescript/fabric/ScreenNativeComponent.d.ts
index 11ed190..f676e08 100644
--- a/node_modules/react-native-screens/lib/typescript/fabric/ScreenNativeComponent.d.ts
+++ b/node_modules/react-native-screens/lib/typescript/fabric/ScreenNativeComponent.d.ts
@@ -55,7 +55,7 @@ export interface NativeProps extends ViewProps {
gestureResponseDistance?: GestureResponseDistanceType;
stackPresentation?: WithDefault<StackPresentation, 'push'>;
stackAnimation?: WithDefault<StackAnimation, 'default'>;
- transitionDuration?: WithDefault<Int32, 350>;
+ transitionDuration?: WithDefault<Int32, 500>;
replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean;
diff --git a/node_modules/react-native-screens/src/fabric/ModalScreenNativeComponent.ts b/node_modules/react-native-screens/src/fabric/ModalScreenNativeComponent.ts
index bb59c4c..d4c14ee 100644
--- a/node_modules/react-native-screens/src/fabric/ModalScreenNativeComponent.ts
+++ b/node_modules/react-native-screens/src/fabric/ModalScreenNativeComponent.ts
@@ -90,7 +90,7 @@ export interface NativeProps extends ViewProps {
gestureResponseDistance?: GestureResponseDistanceType;
stackPresentation?: WithDefault<StackPresentation, 'push'>;
stackAnimation?: WithDefault<StackAnimation, 'default'>;
- transitionDuration?: WithDefault<Int32, 350>;
+ transitionDuration?: WithDefault<Int32, 500>;
replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean;
diff --git a/node_modules/react-native-screens/src/fabric/ScreenNativeComponent.ts b/node_modules/react-native-screens/src/fabric/ScreenNativeComponent.ts
index 4e39336..ab0b313 100644
--- a/node_modules/react-native-screens/src/fabric/ScreenNativeComponent.ts
+++ b/node_modules/react-native-screens/src/fabric/ScreenNativeComponent.ts
@@ -92,7 +92,7 @@ export interface NativeProps extends ViewProps {
gestureResponseDistance?: GestureResponseDistanceType;
stackPresentation?: WithDefault<StackPresentation, 'push'>;
stackAnimation?: WithDefault<StackAnimation, 'default'>;
- transitionDuration?: WithDefault<Int32, 350>;
+ transitionDuration?: WithDefault<Int32, 500>;
replaceAnimation?: WithDefault<ReplaceAnimation, 'pop'>;
swipeDirection?: WithDefault<SwipeDirection, 'horizontal'>;
hideKeyboardOnSwipe?: boolean;
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/node_modules/react-native-screens/ios/RNSScreenStack.mm b/node_modules/react-native-screens/ios/RNSScreenStack.mm
index ea27b03..8f1d005 100644
--- a/node_modules/react-native-screens/ios/RNSScreenStack.mm
+++ b/node_modules/react-native-screens/ios/RNSScreenStack.mm
@@ -1121,16 +1121,7 @@ - (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompone
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
{
RNSScreenView *screenChildComponent = (RNSScreenView *)childComponentView;
-
- // We should only do a snapshot of a screen that is on the top.
- // We also check `_presentedModals` since if you push 2 modals, second one is not a "child" of _controller.
- // Also, when dissmised with a gesture, the screen already is not under the window, so we don't need to apply
- // snapshot.
- if (screenChildComponent.window != nil &&
- ((screenChildComponent == _controller.visibleViewController.view && _presentedModals.count < 2) ||
- screenChildComponent == [_presentedModals.lastObject view])) {
- [screenChildComponent.controller setViewToSnapshot];
- }
+ [screenChildComponent.controller setViewToSnapshot];

RCTAssert(
screenChildComponent.reactSuperview == self,
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {PortalProvider} from '@gorhom/portal';
import React from 'react';
import {LogBox} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {KeyboardProvider} from 'react-native-keyboard-controller';
import {PickerStateProvider} from 'react-native-picker-select';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import '../wdyr';
Expand All @@ -14,7 +15,6 @@ import CustomStatusBarAndBackgroundContextProvider from './components/CustomStat
import ErrorBoundary from './components/ErrorBoundary';
import HTMLEngineProvider from './components/HTMLEngineProvider';
import InitialURLContextProvider from './components/InitialURLContextProvider';
import KeyboardProvider from './components/KeyboardProvider';
import {LocaleContextProvider} from './components/LocaleContextProvider';
import OnyxProvider from './components/OnyxProvider';
import PopoverContextProvider from './components/PopoverProvider';
Expand Down
1 change: 0 additions & 1 deletion src/components/AttachmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ function AttachmentModal({
<>
<Modal
type={modalType}
onSubmit={submitAndClose}
onClose={isOverlayModalVisible ? closeConfirmModal : closeModal}
isVisible={isModalOpen}
onModalShow={() => {
Expand Down
1 change: 0 additions & 1 deletion src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ function ConfirmModal({

return (
<Modal
onSubmit={onConfirm}
onClose={onCancel}
onBackdropPress={onBackdropPress}
isVisible={isVisible}
Expand Down
3 changes: 0 additions & 3 deletions src/components/Modal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ type BaseModalProps = Partial<ModalProps> & {
/** State that determines whether to display the modal or not */
isVisible: boolean;

/** Callback method fired when the user requests to submit the modal content. */
onSubmit?: () => void;

/** Callback method fired when the modal is hidden */
onModalHide?: () => void;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type {RouteProp} from '@react-navigation/native';
import {useRoute} from '@react-navigation/native';
import lodashSortBy from 'lodash/sortBy';
import truncate from 'lodash/truncate';
Expand Down Expand Up @@ -29,6 +28,7 @@ import * as CurrencyUtils from '@libs/CurrencyUtils';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import * as IOUUtils from '@libs/IOUUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
import type {TransactionDuplicateNavigatorParamList} from '@libs/Navigation/types';
import * as OptionsListUtils from '@libs/OptionsListUtils';
import * as PolicyUtils from '@libs/PolicyUtils';
Expand Down Expand Up @@ -71,7 +71,7 @@ function MoneyRequestPreviewContent({
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();
const {windowWidth} = useWindowDimensions();
const route = useRoute<RouteProp<TransactionDuplicateNavigatorParamList, typeof SCREENS.TRANSACTION_DUPLICATE.REVIEW>>();
const route = useRoute<PlatformStackRouteProp<TransactionDuplicateNavigatorParamList, typeof SCREENS.TRANSACTION_DUPLICATE.REVIEW>>();
const {shouldUseNarrowLayout} = useResponsiveLayout();
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || '-1'}`);
Expand Down
Loading
Loading