Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returnType of mixColor is broken in 3.4.2 version #509

Open
YOEL311 opened this issue Aug 27, 2023 · 0 comments
Open

returnType of mixColor is broken in 3.4.2 version #509

YOEL311 opened this issue Aug 27, 2023 · 0 comments

Comments

@YOEL311
Copy link

YOEL311 commented Aug 27, 2023

mixColor returnType broken in react-native-reanimated "3.4.2"

  const sharedAnimation = useSharedValue(1);

 const backgroundColorAnimStyle = useAnimatedStyle(() => {
    return {
      backgroundColor: mixColor(sharedAnimation.value, '#00001', '#12345'),
    };
  }, []);
      <Animated.View style={backgroundColorAnimStyle} />
Type '{ backgroundColor: AnimatedColor; }' is not assignable to type 'StyleProp<AnimateStyle<MaybeSharedValue<StyleProp<ViewStyle>>>>'.
  Type '{ backgroundColor: AnimatedColor; }' is not assignable to type 'AnimateStyle<MaybeSharedValue<ViewStyle>>'.
    Types of property 'backgroundColor' are incompatible.
      Type 'AnimatedColor' is not assignable to type 'ColorValue | SharedValue<AnimatableValue> | Readonly<SharedValue<string>> | undefined'.
        Type 'number' is not assignable to type 'ColorValue | SharedValue<AnimatableValue> | Readonly<SharedValue<string>> | undefined'.ts(2322)
helperTypes.d.ts(32, 5): The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<AnimateProps<ViewProps>, any, any>> & Readonly<...>'

repo to reproducece bug
https://github.com/YOEL311/bugReanimatedRecovery

on redas branch

https://github.com/YOEL311/bugReanimatedRecovery/tree/redas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant