2

I'm using typescript and react-apollo

my code is the following: enter image description here

If I remove the last (Index) the error will go away but I have no idea on how then export the container/component.

Basically, the code works but typescript is not happy with this.

Johhan Santana
  • 2,336
  • 5
  • 33
  • 61

2 Answers2

5

Imprecisely defining compose parameters as any will satisfy the compiler.

export default compose<any>(
  ...
)(Index)
sheepgobeep
  • 743
  • 11
  • 25
1

For others struggling with a similar issue.

Defining a separate generic compose function also will work and can then just be invoked immediately without issue.

const invokableCompose = <any>compose;

export default invokeableCompose(fn1, fn2)(Index);
lukejkw
  • 1,054
  • 13
  • 19