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

React Native Layout Issue while using multiline in TextField #48203

Closed
MuhammadAuonOfficial opened this issue Dec 10, 2024 · 8 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@MuhammadAuonOfficial
Copy link

MuhammadAuonOfficial commented Dec 10, 2024

Description

I am encountering a crash in native code when typing into a TextField with the multiline property set to true. This issue occurs in a new screen I created while working on an Expo SDK 51 project using React Native 0.74. The TextField works flawlessly across other screens in the app, including those with multiline enabled. However, on this specific screen, the app crashes immediately when I start typing.

Below, I have provided the relevant code for the TextField component and the debugger log where the issue is triggered in Xcode.

Environment

Expo SDK: 51
React Native: 0.74
Platforms: iOS
Development Environment: macOS with Xcode

Error Code

void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { 
      ...
      // We must copy layout metrics from Yoga node only once (when the parent
      // node exclusively ownes the child node).
      react_native_assert(childYogaNode->getOwner() == &yogaNode_); <-- com.facebook.react.runtime.JavaScript (10): signal SIGABRT
      ...
}

My Code

<Input
      placeholder="Action Detail"
      multiline
      style={{
            height: 100,
      }}
      value={fields.actionDetail}
      onChangeText={(value) => handleChange('actionDetail', value)}
/>

Steps to reproduce

  1. Use the TextField component with multiline={true} on the new screen.
  2. Run the app on an iOS device or simulator.
  3. Start typing into the TextField.
  4. The app crashes immediately.

React Native Version

0.74.5

Affected Platforms

Runtime - iOS

Areas

Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.1.1
  CPU: (8) arm64 Apple M1
  Memory: 104.31 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.0
    path: /opt/homebrew/opt/node@20/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.2
    path: /opt/homebrew/opt/node@20/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/muhammadauon/.rubies/ruby-3.3.5/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.21829.142.2421.12409432
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 3.3.5
    path: /Users/muhammadauon/.rubies/ruby-3.3.5/bin/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: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

E1210 23:01:48.913069 1867591680 conversions.h:316] react_native_expect failure: value.hasType<std::string>()
E1210 23:01:50.273198 1867591680 YogaLayoutableShadowNode.cpp:688] react_native_assert failure: childYogaNode->getOwner() == &yogaNode_
Assertion failed: (childYogaNode->getOwner() == &yogaNode_), function layout, file YogaLayoutableShadowNode.cpp, line 688.

Reproducer

https://snack.expo.dev/NRyACbtulAltLwe0W0-Ul

Screenshots and Videos

No response

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

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot react-native-bot added Needs: Version Info Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Dec 10, 2024
@react-native-bot
Copy link
Collaborator

Warning

Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@shubhamguptadream11
Copy link
Collaborator

@MuhammadAuonOfficial Can you please check your reproducer once. It's not working correctly. Some files are missing.

@MuhammadAuonOfficial
Copy link
Author

MuhammadAuonOfficial commented Dec 11, 2024

I can't provide a reproducer as the TextField is working on some screens and I can't share the rest of the code.

@shubhamguptadream11

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 11, 2024
@shubhamguptadream11
Copy link
Collaborator

Okay but without this we wouldn't be able to help.
I tried with your sample code provided, crash is not happening by just typing.

@shubhamguptadream11 shubhamguptadream11 removed the Needs: Attention Issues where the author has responded to feedback. label Dec 11, 2024
@MuhammadAuonOfficial
Copy link
Author

I can try adding some screenshots and videos.

@MuhammadAuonOfficial
Copy link
Author

MuhammadAuonOfficial commented Dec 15, 2024

I couldn't reproduce the error, It was a faulty View. I removed the View and It worked fined. Although, I was using gap in that View But Managed to acheive the same functionality using Margin.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Version Info Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants