0

My animations only happen when I resize my window. I am using Reanimated ~2.14.4 and React Native 0.71.3. Skia Web on React Native Web using Expo Router. Perhaps there is a mistake in my setup? Here is a GitHub Repo to demonstrate my issue.

msedge_QrkjJP2R29.gif

Here is my setup:

    const end = 1
    const r = useSharedValue(0);
    const ani = () => {
      r.value = withRepeat(withTiming(end, { duration: 10000 }), -1);
    }

    useEffect(() => {
        // ani()
        console.log(r.value)
    }, [r.value]);

    const animate = useComputedValue(() => {
      // console.log("width", size.current.width)
      ani()
    }, [r]);

...

<Path
          path={path}
          color="orange"
          style="stroke"
          strokeJoin="round"
          strokeWidth={strokeWidth}
          strokeCap="round"
          start={0}
          end={r.value} //reanimated value
        />

Steps to Reproduce:

  1. npx create-expo-app@latest -e with-router
  2. skipped yarn add @shopify/react-native-skia or npm install @shopify/react-native-skia
  3. expo install @shopify/react-native-skia
  4. yarn setup-skia-web
  5. npm install copy-webpack-plugin --save-dev
  6. npm i node-polyfill-webpack-plugin
  7. setup webpack.config.js as outlined in Skia Web Documentation 8. yarn add react-native-level-fs
  8. yarn add path-browserify
  9. added "fs": "react-native-level-fs", "path": "path-browserify", to my dependencies in package.json
  10. added skia to my index.js using code splitting
  11. yarn add path-browserify again
  12. got this Uncaught Error: Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -sASSERTIONS for more info.
  13. used CDN
  14. and setup Reanimated

GitHub Repo to demonstrate my issue

https://github.com/rarepython21/Skia-Web-Reanimated-Bug-w-Expo-Router

Do you think upgrade to Reanimated 3 might solve the issue?

  • Did you manage to work this out? I've been trying skia on react-native and am seeing the same behaviour (using reanimated2 though - will try upgrading and see if there's any change) – speedynomads Apr 06 '23 at 15:15

0 Answers0