Skip to content

v9 type definition for the return of the interpolation/to  #769

@brunolemos

Description

@brunolemos

🐛 Bug Report

The interpolation and to methods should accept any return type, not only the same one from the interpolated value.

For example, when interpolating a height of type number, if I want to return a boolean it complains. See example below.

To Reproduce

<AnimatedView hidden={animatedStyles.height.to(value => (value > 0 ? false : true))} />

Type 'boolean' is not assignable to type 'number'.

Environment

  • react-spring v9.0.0-beta.31
  • react v16.8.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions