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

flexBasis Not Reflecting Updated State Value in Style #47979

Open
rajat693 opened this issue Nov 27, 2024 · 5 comments
Open

flexBasis Not Reflecting Updated State Value in Style #47979

rajat693 opened this issue Nov 27, 2024 · 5 comments
Labels
0.76 Impact: Bug The issue represents a bug somewhere Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@rajat693
Copy link

Description

When dynamically updating a state variable (flexBasisValue) with percentage values and using it in the style prop for components, the updated value is not reflected visually. This issue occurs in React Native latest 0.76.2v but works as expected in React Native 0.74.5v.

Steps to reproduce

  1. npm i
  2. npm start -c

React Native Version

0.76.2

Affected Platforms

Runtime - Android, Runtime - iOS

Areas

Other (please specify)

Output of npx react-native info

for react-native version: 0.74.5
System:
  OS: macOS 14.4
  CPU: (8) arm64 Apple M1
  Memory: 575.59 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: ~/.nvm/versions/node/v20.10.0/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v20.10.0/bin/npm
  Watchman:
    version: 2024.08.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/rajatchaudhary/.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: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.21829.142.2421.12409432
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.1.2
    path: /Users/rajatchaudhary/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.5
    wanted: 0.74.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.76.3 is now available (your project is running on v0.74.5).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.5
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

for React Native version : 0.76.2
System:
  OS: macOS 14.4
  CPU: (8) arm64 Apple M1
  Memory: 79.78 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.10.0
    path: ~/.nvm/versions/node/v20.10.0/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v20.10.0/bin/npm
  Watchman:
    version: 2024.08.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/rajatchaudhary/.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: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.21829.142.2421.12409432
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.1.2
    path: /Users/rajatchaudhary/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.2
    wanted: latest
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.2
    wanted: 0.76.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.76.3 is now available (your project is running on v0.76.2).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.3
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.2&to=0.76.3
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

NA

Reproducer

for RN 0.74.5 - https://github.com/rajat693/expo51-flexbasis, for RN 0.76.2 - https://github.com/rajat693/expo52-flexbasis

Screenshots and Videos

No response

@rajat693 rajat693 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Nov 27, 2024
@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.76.3. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot
Copy link
Collaborator

Tip

Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@rajat693
Copy link
Author

for this repo, I have updated to latest react-native version 0.76.3 but it is still not working.

@migueldaipre
Copy link
Collaborator

Hey @rajat693, Thanks for opening this issue.

I reproduced the issue locally with the new arch (without expo) and with integers I could also see the issue.

@migueldaipre migueldaipre added Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Impact: Bug The issue represents a bug somewhere 0.76 and removed Needs: Triage 🔍 Newer Patch Available labels Nov 27, 2024
@NickGerleman
Copy link
Contributor

NickGerleman commented Nov 29, 2024

This may be the same Yoga bug around incorrect invalidation of flex basis on constraint changes. facebook/yoga#1552 @rozele

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.76 Impact: Bug The issue represents a bug somewhere Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants