question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shared values cannot be updated (master)

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jakub-gonetcommented, Sep 3, 2021

@karol-bisztyga and I don’t work on Reanimated 2. I suggest creating a new issue with a repro example.

0reactions
akinncarcommented, Nov 8, 2021

any update? have the same problem on 2.1.0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found