-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
I observed odd layout behaviour if I create two instances of the same component with the same props(or more likely if rendering outcome is the same). Basically, if on the screen there're two instances of the same component layout related styles of the second instance are overwritten by the first instance of the component. Hence, we can get two different results based on the order of components.
Issue seems to happen if rendering outcomes are the same. In my case the same margin(or padding) and Text's value. If value of text input is changed as in the recorded video, then layout is correct.
I already checked that the same issue happen for TextInput wrapped by View.
I'm trying to debug the problem, so any suggestions where should I start investigating are welcomed.
Steps to reproduce
- Install deps of the application with reproducible bug
- run the app on an android device or emulator
- Toggle the value by clicking the button
- Observe change of second component width despite the fact that only value is changed.
React Native Version
0.76.5
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer
Output of npx react-native info
System:
OS: macOS 14.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 82.25 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.20.2
path: ~/.nvm/versions/node/v18.20.2/bin/node
Yarn:
version: 4.5.2
path: ~/.nvm/versions/node/v18.20.2/bin/yarn
npm:
version: 10.5.0
path: ~/.nvm/versions/node/v18.20.2/bin/npm
Watchman:
version: 2024.10.21.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /Users/bogusz/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "33"
- "34"
- "34"
- "34"
- "35"
Build Tools:
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 34.0.0
- 35.0.0
- 35.0.0
System Images:
- android-29 | Google APIs ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google Play ARM 64 v8a
- android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23339.11.2421.12700392
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.12
path: /usr/bin/javac
Ruby:
version: 2.7.5
path: /Users/bogusz/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.5
wanted: 0.76.5
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false
Stacktrace or Logs
no logs
Reproducer
https://github.com/BogiKay/android-layout-bug