Shared values cannot be updated (master)
See original GitHub issueI tried Reanimated from master on iOS (commit 5bba1b30f6ac1c1d6a3cc06eb6d46e8067137828).
Seems like when trying to change a shared value, it doesn’t do anything anymore.
Expected result: Text ‘Hello’ appears Actual result: Blank screen (opacity stays at 0).
Snack or minimal code example
import React, {useEffect} from 'react';
import {View} from 'react-native';
import Animated, {
useAnimatedStyle,
useSharedValue,
} from 'react-native-reanimated';
export const Playground = () => {
const opacity = useSharedValue(0);
useEffect(() => {
opacity.value = 1;
}, [opacity]);
const style = useAnimatedStyle(() => {
return {
opacity: opacity.value,
};
});
return (
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<Animated.Text style={style}>Hello</Animated.Text>
</View>
);
};
Package versions
- React: 16.13.1
- React Native: 0.63.2
- React Native Reanimated: master
- NodeJS: 14.13.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Git Push error: refusing to update checked out branch
After reading NowhereMan's answer, a quick fix was to go to the "remote" directory and temporarily checkout another commit, push from the directory...
Read more >SQL Server Troubleshooting: Master Data Services ...
Database creation fails with error “Data is Null. This method or property cannot be called on Null values.” When you try to create...
Read more >Picklist values for Master record type
My problem is that the default page layout now includes new picklist values that I need to hide...which I can't do without creating...
Read more >Error 'bad value for restricted picklist field' appears when a ...
This error can occur when the value 'Label' and 'API Name' are different in the values, and you use the 'Label' name in...
Read more >Core Values - Scaled Agile Framework
Find people who share your values, and you'll conquer the world together. —John Ratzenberger. Core Values. The four Core Values of alignment, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@karol-bisztyga and I don’t work on Reanimated 2. I suggest creating a new issue with a repro example.
any update? have the same problem on 2.1.0