-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[iOS] Navigation Bar Size Issue with codegenNativeComponent and modalPresentationStyle: .pageSheet in React Native #47600
Comments
I have an issue with the onLayout on iOS where the screen height is not measured correctly on the first render using the Dimensios.get("screen").height! |
Is it also the case on iOS 18? |
I got a similar issue on ios 18 |
Hey @thuongtv-vn, the above issue does not appear on iOS 18. Is it also something with a modal that you are experiencing? |
Umm.. It is still occurring intermittently, even on iOS 18. |
Hmm that's interesting. For me it's seems to be fine when I run it on iOS 18. |
I've tried to investigate this one, but as of now, I am not sure why this happens. Repros for other related issues mentioned above would probably be extremely helpful 🙏 |
@dp221125 Sorry if this took that much time. I think that the current setup and example is not the right one and it is a bit confusing. I don't think that that's the right way to achieve what you want to achieve. Custom components, the one that you can create with For what you want achieve from the reproducer you shared, we have a guide in the website (Integrating with An Existing app ) that we updated recently and that will let you load a React Native screen in an existing app. Once the screen is loaded, you can use regular React Native concepts and libraries to build your experience. |
Hello, thank you for your response. First of all, we currently have an app that is fully implemented natively. When the app is launched, the RN app should be loaded from the AppDelegate. From the React Native screens, when a specific action is performed (for example, pressing a particular button on the screen), the app needs to navigate to an already implemented native screen. Therefore, I expect to use codegenNativeComponent to provide users with the native screens (implemented as UIViewController) from React Native. |
If I understand correctly:
Is this correct? One way you can achieve what you need is by implementing a module, instead of a component, that could be a Coordinator.
|
I �encountered the same issue when navigating "react-native screen" in a brown field app(new archi mode). This only happens when using I suspect something might be happening in RNScreens.. but no clue so far. Could you give me some ideas to investigate this issue? @cipolleschi Screen.Recording.2025-01-15.at.23.31.17.movI'm using following versions :
|
@CHOIMINSEOK have you tried to open an issue in RNScreens repo? Software Mansion's people are pretty responsive and on top of New Architecture stuff. They knows the library better, so they could help you better and faster! |
I will, Thank you @cipolleschi Anyway, @dp221125 and I are actually in same project. We also expected that there's something wrong on the way we embed existing native ViewController on top of RN App like you mensioned above #47600 (comment) , but it's still happening even our navigation works on react-navigation without any Native Component. Maybe some configurations of native part affect on this... 🤔 |
If you can provide a reproducer using this template, where you can add |
The issue was caused by the behavior of SafeAreaInset. On iOS, pages presented using a modal style don’t require a top safe area margin because the system handles it automatically. However, useSafeAreaInsets always returns a fixed top inset value regardless of the presentation style of the target page. We resolved the issue by removing the top inset. |
So this is a problem of |
I believe there are two issues:
The second issue can be resolved by removing the top inset on the page. However, the first issue, which is the original problem discussed in this thread, remains unresolved. Our team no longer needs to address it. If no one else is interested in tackling the original issue, I think we could close this thread. Thanks for your help, @cipolleschi! 😊 |
Description
In a React Native environment, I'm using
codegenNativeComponent
to display a native screen. On this native screen, when I present a new screen withmodalPresentationStyle
set to.pageSheet
, the navigation bar size becomes abnormal. Although this might appear to be an issue with the native side because I’m using native screens, I don’t experience this problem when presenting a modal with .pageSheet without React Native.Steps to reproduce
React Native Version
0.76.1
Affected Platforms
Runtime - iOS
Areas
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/dp221125/RNPlayground
Screenshots and Videos
React Native
Simulator.Screen.Recording.-.iPhone.13.mini.-.2024-11-14.at.11.35.55.mp4
iOS Native (not using React Native)
Simulator.Screen.Recording.-.iPhone.13.mini.-.2024-11-14.at.11.34.42.mp4
ScreenShot
The text was updated successfully, but these errors were encountered: