After following the instructions on https://docs.expo.io/versions/latest/sdk/reanimated/ for enabling react-native-reanimated v2 on expo and trying to use useSharedValue the next error appears:
TypeError: (0, _reactNativeReanimated.useSharedValue) is not a function. (In '(0, _reactNativeReanimated.useSharedValue)(0)', '(0, _reactNativeReanimated.useSharedValue)' is undefined)
file where i'm using it:

pckage.json deps:

babel config:

app.json:

I expect to use useSharedValue to update the x value while swapping
The app crashes due finding an existing function undefined
Hello!
Congratulations! Your issue passed the validator! Thank you!
Could you try installing Rea2 via yarn and report back here? I think I've seen similar issues in the past when using npm instead of yarn.
I am having a similar issue with VSCode. I am using Yarn. Same project works fine outside of VSCode by just running yarn iOS
Launching the application
Attaching to the application
Starting debugger app worker.
Established a connection with the Proxy (Packager) to the React Native application
Debugger worker loaded runtime on port 36395
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
node_modules/react-native/Libraries/Core/ExceptionsManager.js:179
Running application ModernBottomSheet ({
initialProps = {
};
rootTag = 11;
})
node_modules/react-native/Libraries/Utilities/RCTLog.js:47
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
node_modules/react-native/Libraries/Core/ExceptionsManager.js:179
Running surface LogBox ({
initialProps = {
};
rootTag = 21;
})
node_modules/react-native/Libraries/Utilities/RCTLog.js:47
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
node_modules/react-native/Libraries/Core/ExceptionsManager.js:179
Failed to mount LogBox within 1s
Could you try installing Rea2 via yarn and report back here? I think I've seen similar issues in the past when using npm instead of yarn.
I'm gonna try it tomorrow but why is this happening? I mean, npm is also a package manager, I've never had problems installing packages via npm so why is this library different? Btw thanks a lot for the quick response jakub 馃挴
Could it be some babel failure when babel is attaching the plugin? Speaking from the absolute ignorance but I've dived a little into the package code and the function is there waiting to be used
img from node_modules/react-native-reanimated/src/reanimated2/Hooks.js:

I've just tried it with yarn, same error... I've seen another opened issues having the same problem
Also I have the same problem, can not use v2 package, useSharedValue is undefined. Maybe someone solved this?
Running into this same problem. Configured according to the expo guide. Receiving this error:
(0, _reactNativeReanimated.useSharedValue) is not a function. (In '(0, _reactNativeReanimated.useSharedValue)(0)', '(0, _reactNativeReanimated.useSharedValue)' is undefined)
https://docs.expo.io/versions/latest/sdk/reanimated/
I had this problem and it just resolved luckily, here was my steps:
Perhaps removing the package and starting over was enough to reset it and wire it up properly.
still facing this error using react native cli , anyone solved it?
the error persist
Most helpful comment
the error persist