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

toDataURL only works the second time it is executed in old Arch #2233

Open
imanderson opened this issue Feb 26, 2024 · 2 comments · May be fixed by #2234
Open

toDataURL only works the second time it is executed in old Arch #2233

imanderson opened this issue Feb 26, 2024 · 2 comments · May be fixed by #2234

Comments

@imanderson
Copy link

Hello,

in iOS and old Arch, I found that the callback on toDataURL method will only be called the second time of asking. This is due to when the queue from UIManager in iOS is flushed. See facebook/react-native#1365

I traced the problem to the iOS implementation and will do a PR with my fix.

Environment info

React native info output:

System:
  OS: macOS 14.3.1
  CPU: (12) arm64 Apple M2 Max
  Memory: 96.39 MB / 32.00 GB
  Shell:
    version: 3.6.0
    path: /opt/homebrew/bin/fish
Binaries:
  Node:
    version: 18.19.1
    path: ~/.nvm/versions/node/v18.19.1/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.19.1/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v18.19.1/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11330709
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: 0.73.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Library version: 14.1.0

Steps To Reproduce

Simply run the Examples App in this repo with react-native 0.73.4 and go to "Tap the shapes to render the Image below based on the base64-data of the Svg". If you click once, nothing happens, but if you click a second time, the image is rendered.

@imanderson imanderson linked a pull request Feb 26, 2024 that will close this issue
4 tasks
@buschco
Copy link

buschco commented Apr 19, 2024

Thank you for the issue and the fix. Works well for me 🙏

@imanderson
Copy link
Author

Thank you for the issue and the fix. Works well for me 🙏

No problem! Im glad it helps 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants