Error: Reading from _value
directly is only possible on the UI runtime
#4883
Unanswered
vaibhavshah0201
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I'm trying to use useAnimatedStyle in my component I facing this issue when its render.
`const translateX = useSharedValue(0);
const translateY = useSharedValue(0);
type ContextType = {
translateX: number;
translateY: number;
};
const panGestureEvent = useAnimatedGestureHandler<
PanGestureHandlerGestureEvent,
ContextType
});
const rStyle = useAnimatedStyle((): any => {
return {
transform: [
{
translateX: translateX.value,
},
{
translateY: translateY.value,
},
],
};
});
return (
<Animated.View style={[rStyle]}>
<Image
style={[{height: 100, width: 100}]}
source={{uri: props.uploadedImage.path}}
/>
</Animated.View>
)
`
package.json
"react-native-gesture-handler": "^2.12.1",
"react-native-reanimated": "^3.4.1",
Beta Was this translation helpful? Give feedback.
All reactions