Description
When the child view of a modal is given alignItems: 'center' or justifyContent: 'center' the UI breaks while the modal is opens.
I could reproduce this behaviour when the modal contains an Image or an SVG, but I've also seen text flickers in the same manner.
While the flicker is prominent in New Architecture, it is also occurring in legacy when trying multiple times.
Steps to reproduce
Make a modal with child view having alignItems: 'center'
Add an Image and a Text to the child View
Flicker occurs when the modal is opened.
React Native Version
0.80.2
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 15.5
CPU: (8) arm64 Apple M1
Memory: 178.75 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.18.1
path: ~/.nvm/versions/node/v20.18.1/bin/node
Yarn:
version: 3.6.4
path: /opt/homebrew/bin/yarn
npm:
version: 10.8.2
path: ~/.nvm/versions/node/v20.18.1/bin/npm
Watchman:
version: 2025.03.10.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.5
- iOS 18.5
- macOS 15.5
- tvOS 18.5
- visionOS 2.5
- watchOS 11.5
Android SDK:
API Levels:
- "28"
- "29"
- "31"
- "32"
- "33"
- "34"
- "35"
Build Tools:
- 28.0.3
- 30.0.3
- 33.0.1
- 34.0.0
- 35.0.0
System Images:
- android-34 | Google APIs ARM 64 v8a
- android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23339.11.2421.12550806
Xcode:
version: 16.4/16F6
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.1
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 19.1.1
wanted: 19.1.1
react:
installed: 19.1.0
wanted: 19.1.0
react-native:
installed: 0.80.2
wanted: 0.80.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
Not applicable, since it is a UI bug and nothing is logged as crash
MANDATORY Reproducer
https://github.com/sanyam12/ModalFlicker
Screenshots and Videos
Screen.Recording.2025-07-30.at.10.40.56.PM.mov
Current Behaviour: Modal content is first displayed in top right corner, then at it's intended position.
Expected Behaviour: Modal content should be displayed in the center without any flicker.
Description
When the child view of a modal is given
alignItems: 'center'orjustifyContent: 'center'the UI breaks while the modal is opens.I could reproduce this behaviour when the modal contains an Image or an SVG, but I've also seen text flickers in the same manner.
While the flicker is prominent in New Architecture, it is also occurring in legacy when trying multiple times.
Steps to reproduce
alignItems: 'center'React Native Version
0.80.2
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/sanyam12/ModalFlicker
Screenshots and Videos
Screen.Recording.2025-07-30.at.10.40.56.PM.mov
Current Behaviour: Modal content is first displayed in top right corner, then at it's intended position.
Expected Behaviour: Modal content should be displayed in the center without any flicker.