Code Monkey home page Code Monkey logo

Comments (8)

wcandillon avatar wcandillon commented on June 5, 2024

from react-native-skia.

meftunca avatar meftunca commented on June 5, 2024

I had an app running with normal react-native and it was working. I converted it to expo to make an external library but I'm having the following problems. I'm trying to create an example with Snack, but I probably won't be able to because of version incompatibility. Could you please review my repo

from react-native-skia.

wcandillon avatar wcandillon commented on June 5, 2024

from react-native-skia.

meftunca avatar meftunca commented on June 5, 2024

The simple example I created works :D. I'm trying to find the source of the error. I would like to ask you if there is a possibility of having a problem with values of type sharedValue passed with react-context. Is there a possibility of having such a problem?

from react-native-skia.

meftunca avatar meftunca commented on June 5, 2024

Snack url

from react-native-skia.

wcandillon avatar wcandillon commented on June 5, 2024

I tried the snack and it appear to work properly.
Please be mindful when reporting such issues to clearly state what the bug appears to be, how to reproduce it as easily as possible and which platforms and versions of the package are affected by the issue.

I will close the issue for now. If you have a reproduction that we can confirm, we will re-open the issue.

from react-native-skia.

meftunca avatar meftunca commented on June 5, 2024

Hi @wcandillon, I need to explain the problem in detail. I finally found the cause.

To explain the problem in its simplest form, SharedValue or any other Matrix4 value unfortunately does not work with the matrix={} prop of Skia components. This should be obvious in the Snack application I shared. If you can drag an element with a green background, this is the view of the gestureHandler. Skia path should have a white background.

What did I try to run Matrix4 ?

  1. with SharedValue
  2. React useState/useReducer/useSyncExternalStore
  3. EventEmitter
    I found no other way to try :)

How did I solve it?
Matrix4 is definitely not working and I created it again with a value of type SkMatrix. It worked successfully the first time :) The solution to 3 days of tedious work for me was to switch back to SkMatrix from Matrix4 that you used in your examples. I don't know exactly why it didn't work but Matrix4 really didn't work.

Finally, I think we should complete the examples and missing documentation about this in the documentation.

By the way, my friend, you are a great guy and you share excellent examples. I am a bit new to canvas/svg. I apologize for advancing this issue in a way that will tire you out. I will continue to learn as much as I can and provide people with useful ideas, examples and products.

Good work

from react-native-skia.

wcandillon avatar wcandillon commented on June 5, 2024

The problem is that on snack, you can only use RN Skia 0.1.221 support for Matrix4 arrived in 0.1.229.
Using SkMatrix on 0.1.221 is probably the best way or you can use expo devclient to run the latest version of Skia in your project.

from react-native-skia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.