NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
34.82k stars 4.72k forks source link

RN 环境下,cssName 有 "\/" 样式不生效 #15568

Closed xushuailing closed 2 weeks ago

xushuailing commented 3 weeks ago

相关平台

React Native

使用框架: React

复现步骤

初始化项目后,添加样式即可

.red {
  background-color: rgb(255 0 0 / 1)
}
.red\/50 {
  background-color: rgb(255 0 0 / 0.5)
}
.blue {
  color: blue;
}
.blue\/50 {
  color: rgb(0 0 255 / 0.5)
}

期望结果

".red\/50"和".blue\/50"生效

实际结果

样式不生效

环境信息

👽 Taro v3.6.27

  Taro CLI 3.6.27 environment info:
    System:
      OS: macOS 12.7.1
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
      Yarn: 1.22.22 - ~/.nvm/versions/node/v20.12.0/bin/yarn
      npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.6.27 => 3.6.27 
      @tarojs/components: 3.6.27 => 3.6.27 
      @tarojs/helper: 3.6.27 => 3.6.27 
      @tarojs/plugin-framework-react: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-alipay: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-h5: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-jd: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-qq: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-swan: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-tt: 3.6.27 => 3.6.27 
      @tarojs/plugin-platform-weapp: 3.6.27 => 3.6.27 
      @tarojs/react: 3.6.27 => 3.6.27 
      @tarojs/rn-runner: 3.6.27 => 3.6.27 
      @tarojs/rn-supporter: 3.6.27 => 3.6.27 
      @tarojs/runtime: 3.6.27 => 3.6.27 
      @tarojs/runtime-rn: 3.6.27 => 3.6.27 
      @tarojs/shared: 3.6.27 => 3.6.27 
      @tarojs/taro: 3.6.27 => 3.6.27 
      @tarojs/taro-loader: 3.6.27 => 3.6.27 
      @tarojs/taro-rn: 3.6.27 => 3.6.27 
      @tarojs/webpack5-runner: 3.6.27 => 3.6.27 
      babel-preset-taro: 3.6.27 => 3.6.27 
      eslint-config-taro: 3.6.27 => 3.6.27 
      expo: ~47.0.3 => 47.0.14 
      react: ^18.1.0 => 18.2.0 
      react-native: ^0.70.1 => 0.70.15