react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

animatedProps with disabled not updating

Open believer opened this issue 1 year ago • 0 comments

Description

Using animatedProps to update a disabled prop never updates the value. Logging inside useAnimatedProps displays the correct values, but the changes don't seem to update the component.

  1. Initially, the first button is displayed as disabled.
  2. We can click the second and third button, which updates the styling correctly, but the disabled state remains on the first button (after clicking on third, I try to click “first” again in the video).

https://github.com/user-attachments/assets/1ed533e9-fa0e-4d26-a45e-c898e1c79ca7

Steps to reproduce

  1. Use animatedProps to set disabled on a <Pressable> button that's been augmented using Animated.createAnimatedComponent.
  2. The disabled value never updates, even though the value changes inside the useAnimatedProps hook.

Snack or a link to a repository

https://github.com/believer/rn-animated-props-disabled

Reanimated version

3.10.1

React Native version

0.74.5

Platforms

iOS

JavaScript runtime

None

Workflow

Expo Go

Architecture

None

Build type

None

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

believer avatar Oct 07 '24 07:10 believer