-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
area: typescriptTypescript issuesTypescript issueskind: bugSomething isn't workingSomething isn't working
Milestone
Description
🐛 Bug Report
A new version of @types/react
recently came out which depends on [email protected]
, which in turn has better type definitions for CSS properties.
The latest [email protected]
is incompatible with these types when trying to use the style
prop on animated components, throwing this example error (I used the opacity
property, but the same holds true for most other properties):
Types of property 'opacity' are incompatible.
Type 'SpringValue<number>' is not assignable to type '"initial" | "inherit" | "-moz-initial" | "revert" | "unset" | FluidValue<Globals, any> | undefined'.
Type 'SpringValue<number>' is not assignable to type 'FluidValue<Globals, any>'.
The types returned by 'get()' are incompatible between these types.
Type 'number' is not assignable to type 'Globals'.ts(2322)
To Reproduce
Try to use the useTransition
hook with it's returned callback, and render an <animated.div />
with the styles given by the callback (see repro link).
Expected behavior
There should not be a compile-time error for the style
prop.
Link to repro (highly encouraged)
https://codesandbox.io/s/elegant-mclaren-39xuy?file=/src/App.tsx
Environment
react-spring
v9.0.0-rc.3react
v16.13.1
emanuel-lundman, Lumen27, illiaGorbatov, sgrezza, Amecy and 56 more
Metadata
Metadata
Assignees
Labels
area: typescriptTypescript issuesTypescript issueskind: bugSomething isn't workingSomething isn't working