[Android][NewArch] Weird layout styling if multiple instances of the same component with the same props #48249
Labels
Issue: Author Provided Repro
This issue can be reproduced in Snack or an attached project.
p: Callstack
Partner: Callstack
Partner
Platform: Android
Android applications.
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
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
React Native Version
0.76.5
Affected Platforms
Runtime - Android
Areas
Fabric - The New Renderer
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/BogiKay/android-layout-bug
Screenshots and Videos
android-layout-issue.webm
The text was updated successfully, but these errors were encountered: