facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.74k stars 24.16k forks source link

backgroundColor is not being applied to Text and View when giving borderStyle as 'dotted' or 'dashed' #45368

Closed shubhamguptadream11 closed 1 month ago

shubhamguptadream11 commented 1 month ago

Description

Text and View lose backgroundColor on iOS new Architecture, whenborderStyle is "dashed" or "dotted", and borderWidth is 0.

Steps to reproduce

  1. Clone the repro app provided
  2. Launch iOS build with New Architecture enabled.
  3. In App.tsx look for View and Text styles and set their borderStyle to either "dotted" or "dashed" and backgroundColor to something more visible (e.g, "red")
  4. Observe that backgroundColor is not getting applied
  5. change either borderStyle to solid. Observe backgroundColor is set correctly now

React Native Version

0.74.3

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx react-native info

System:
  OS: macOS 13.6.2
  CPU: (12) arm64 Apple M2 Pro
  Memory: 169.55 MB / 32.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: 3.6.4
    path: ~/.yvm/shim/yarn
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v18.20.2/bin/npm
  Watchman:
    version: 2024.05.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK: Not Found
IDEs:
  Android Studio: Giraffe 2022.3.1 Patch 4 Giraffe 2022.3.1 Patch 4
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 1.8.0_292
    path: /Users/shubhamgupta/.sdkman/candidates/java/current/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/shubhamgupta/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No logs

Reproducer

https://github.com/shubhamguptadream11/reproducer-react-native-bg-color-view

Screenshots and Videos

Actual simulator_screenshot_0AC87FC1-8C92-484C-927A-2C71BD699EF8

Expected simulator_screenshot_8ECE9251-B3A8-4C90-8843-6DD0A9CB5BE7

shubhamguptadream11 commented 1 month ago

@cortinico I had added a fix for this issue. PR: https://github.com/facebook/react-native/pull/45369 Please check once.

realsoelynn commented 1 month ago

Closing this as fix is merged https://github.com/facebook/react-native/pull/45430