Skip to content

TypeScript complains about passing SpringValue to Vector3 props #1205

@lennerd

Description

@lennerd

🐛 Bug Report

Responding to #892 (comment)

When using react-spring with react-three-fiber in version 9.0.0-rc3, Typescript will complain about invalid types when using SpringValues. As a quick fix it's possible to use (prop as any) as T (as seen in the codesandbox example below with color).

The animation is working as expected.

image

Expected behavior

Augmented components from react-spring/three accept both SpringValue<T> and T (T being Vector3 for example).

Link to repro (highly encouraged)

https://codesandbox.io/s/recursing-bohr-xri52?file=/src/index.tsx

Environment

  • react-spring v9.0.0-rc3
  • react v17.0.0

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