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.
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:
npx create-expo-app@latest -e with-router
- skipped
yarn add @shopify/react-native-skia
ornpm install @shopify/react-native-skia
expo install @shopify/react-native-skia
yarn setup-skia-web
npm install copy-webpack-plugin --save-dev
npm i node-polyfill-webpack-plugin
- setup
webpack.config.js
as outlined in Skia Web Documentation 8.yarn add react-native-level-fs
yarn add path-browserify
- added
"fs": "react-native-level-fs", "path": "path-browserify",
to my dependencies inpackage.json
- added skia to my
index.js
using code splitting yarn add path-browserify
again- 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.
- used CDN
- 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?