Open
Description
🐛 Bug Report
Using react-spring in conjunction with styled-components css prop in Typescript causes a "Type instantiation is excessively deep and possibly infinite" compilation error.
There are several ways to enable typescript support for the css prop from styled-components in typescript listed here: DefinitelyTyped/DefinitelyTyped#31245 all of which cause this error.
To Reproduce
Steps to reproduce the behavior:
- Create a typescript react app with
npx create-react-app react-spring-css-prop-error --template typescript
- Add react-spring, styled-components and types:
yarn add react-spring styled-components @types/styled-components
- Add reference to css prop types in App.tsx:
/// <reference types="styled-components/cssprop" />
- Attempt to use animated compenent (e.g. animated.div) in App component
Expected behavior
<animated.div></animated.div>
should have no compilation errors
Link to repro
Environment
react-spring
v9.1.2react
v17.0.2styled-components
v5.3.0- '@types/styled-components` v5.1.9