Closed aqos156 closed 2 years ago
maybe connected with https://github.com/software-mansion/react-native-reanimated/issues/3049 ?
@aqos156 can you provide minimal reproducible repo, so I can clone it, launch it and reproduce the issue?
@mateusz1913 https://github.com/aqos156/paralax-demo here is the demo.
To start the app run the following in the root of the project. The app and all setup regarding it is inside apps/example
. Package version can be changed via the root package.json file. If you want to add another dependency, yarn add
it and make sure it is present also in the apps/example/package.json
file.
npx nx run-ios
npx nx run-android
npx nx start # runs only packager
@aqos156
Ok, so I reproduced the issue, however, it seems to be related to nx workspaces
setup.
On the error screenshot you provided, worklet location is <root>/node_modules/react-native-reanimated/lib/hook/useAnimatedStyle.js
- this indicates that the useAnimatedStyle
hook is not correctly "auto-workletized" (reanimated does it here)
I tried to manually annotate 'worklet';
in each place where useAnimatedStyle
& useAnimatedReaction
are used for DetailsHeaderScrollView
and issue was eliminated, however when I tried to start dragging, the same error popped up for useAnimatedScrollHandler
hook. Again, this indicates that it's specific to nx
tool and reanimated library not workletizing its built-in hooks when added as a package to nx workspaces
.
I also tried to add the reanimated babel plugin to root babel.config.json - no effect.
Closing as it has nothing to do with the sticky parallax header library
I'm still seeing this issue but only with this library and not any other animations I'm doing. Which is very confusing. Using Nx myself inside a monorepo.
I'm also having the same issue with nx monorepo. Did you figure out the issue @mikehuebner , @aqos156 ?
Environment
Library version: 1.0.0-rc.6 OS version: iPhone 13, iOS 15.5
Affected platforms
Current behavior
When in NX workspace, on iOS the app opens with the given error and on Android app crashes (doesn't even start) and the same error is in logcat. No error is displayed in metro.
Code:
Expected behavior
To work without errors.
Reproduction