react / react/react-native

Cannot use DynamicColorIOS or PlatformColor with Share tintColor option

Đang mở
#30,396 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

API: Share Needs: Repro Needs: Triage :mag: Never gets stale Platform: iOS
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

Following up with my previous issue regarding the new PlatformColor and DynamicColorIOS APIs. I like this quest!

I've encountered another issue, this time when using these new color APIs with the Share API. Anytime I try to use either a PlatformColor or DynamicColorIOS as the tint color I get the following error:

[Fri Nov 13 2020 19:51:50.612]  WARN     Possible Unhandled Promise Rejection (id: 3):
Invariant Violation: Unexpected color given for options.tintColor

React Native version:

System:
    OS: macOS 11.0.1
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 20.24 MB / 20.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.3.0 - /var/folders/n8/l8xdjt192lb9lpfrkyh9v57m0000gn/T/yarn--1605466607306-0.2082520059346018/node
    Yarn: 1.22.5 - /var/folders/n8/l8xdjt192lb9lpfrkyh9v57m0000gn/T/yarn--1605466607306-0.2082520059346018/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_272 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use a PlatformColor or DynamicColorIOS to set the tint color option for the Share API
  2. Call the share API
  3. No share sheet appearing and error in the logs

Expected Results

Share sheet should appear without errors

Snack, code example, screenshot, or link to a repository:

import { PlatformColor, Share } from 'react-native'

const shareWithPlatformColor = () => Share.share('This is a nice content to share', {
  tintColor: PlatformColor('systemYellow'),
})

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ entry point của React Native Share API và tái hiện vấn đề bằng ví dụ PlatformColor được cung cấp trên iOS. Theo dõi quá trình validation của tintColor tạo ra “Unexpected color given for options.tintColor.”. Hoàn tất khi share sheet xuất hiện mà không có lỗi khi tintColor sử dụng PlatformColor hoặc DynamicColorIOS.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
ios, javascript, react
Lĩnh vực
api, mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.