Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Animated regular/calculated issue #504

Open
Labels
@MoOx

Description

I am currently having an optional interpolation depending on an optional animated value

~transform=[|
 Transform.translateY(
 ~translateY=
 Animated.(
 animatedFloat(
 scrollYAnimatedValue
 ->Option.map(scrollYAnimatedValue =>
 Animated.Value.add(
 state.animation,
 Value.interpolate(
 scrollYAnimatedValue,
 Interpolation.(
 config(
 ~inputRange=[|(-200.), 1.|],
 ~outputRange=
 fromFloatArray([|(-200.), 1.|]),
 (),
 )
 ),
 ),
 )
 )
 ->Option.getWithDefault(state.animation),
 )
 ),
 ),
|],

This code should work but doesn't compile, complaining that ->Option.getWithDefault(state.animation) isn't the same type as the interpolation.

Error: This expression has type
 ReactNative.Animated.value(ReactNative.Animated.regular) =
 ReactNative.Animated.value(ReactNative.Animated.regular)
 but an expression was expected of type
 ReactNative.Animated.value(ReactNative.Animated.calculated) =
 ReactNative.Animated.value(ReactNative.Animated.calculated)
 Type ReactNative.Animated.regular = ReactNative.Animated.regular
 is not compatible with type
 ReactNative.Animated.calculated = ReactNative.Animated.calculated

We should have something to tell that a regular & calculated are the same at the end, don't we?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /