I trying to implement basic example of react-spring animation but Typescript and also console after compilation throws a lot of errors
I took on the background this example:
import { Spring } from 'react-spring'
<Spring from={{ opacity: 0 }} to={{ opacity: 1 }}>
{props => <div style={props}>hello</div>}
</Spring>
Typescript throws :
JSX element type 'Spring' does not have any construct or call signatures.
Parameter 'props' implicitly has an 'any' type.
Property 'toggle' does not exist on type 'Readonly<{}>'.
Type '{ children: ({ x }: { x: number; }) => Element; native: true; from: { x: number; }; to: { x: number; }; config: { duration: number; }; }' is not assignable to type 'IntrinsicAttributes & In trinsicClassAttributes> & Readonly<{ children?: ReactNode; }> & Readonly>'. Property 'native' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Readonly<{ children?: ReactNode; }> & Readonly>'.
Property 'interpolate' does not exist on type 'number'.
Property 'interpolate' does not exist on type 'number'.
Parameter 'x' implicitly has an 'any' type.
and futuremore from console:
react-dom.development.js:55 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
The above error occurred in the component: in div in Unknown. Consider adding an error boundary to your tree to customize error handling behavior.
React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. in Unknown
How to overcome this issues? Should I wait for official package with typescript support or should I add just global typings for this lib?