I've just got hit with this one.
Turns out that in the file node_modules/@types/react-transition-group/TransitionGroup.d.ts
There is this type:
type TransitionGroupProps<T extends keyof JSX.IntrinsicElements = "div", V extends ReactType = any> =
(IntrinsicTransitionGroupProps<T> & JSX.IntrinsicElements[T]) | (ComponentTransitionGroupProps<V>) & {
children?: ReactElement<TransitionProps> | Array<ReactElement<TransitionProps>>;
childFactory?(child: ReactElement): ReactElement;
[prop: string]: any;
};
And this is making the compilation fail with this error:
ERROR in [at-loader] ./node_modules/@types/react-transition-group/TransitionGroup.d.ts:16:30
TS2707: Generic type 'ReactElement<P, T>' requires between 1 and 2 type arguments.
ERROR in [at-loader] ./node_modules/@types/react-transition-group/TransitionGroup.d.ts:16:45
TS2707: Generic type 'ReactElement<P, T>' requires between 1 and 2 type arguments.
I've found that if I replace this:
childFactory?(child: ReactElement): ReactElement;
for this:
childFactory?(child: ReactElement<any, any>): ReactElement<any, any>;
But this is not the real solution, or problem I think...
How should I fix this?
It looks like this commit removed all the template values and caused the break. I was able to resolve this by explicitly adding a version (2.0.15) to the package.
npm install @types/[email protected]
2.0.15 is the latest that works. 2.0.16 and newer contains the bad commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With