I've been facing a challenge with fixing this typescript error related to using ramda's groupBy function:
245: const groups = R.groupBy((row: Record) => {
246: return row[this.props.groupBy]
247: })(this.props.data)
The definition of this.props.groupBy is as follows:
groupBy?: {[K in keyof Record]}
data: Array<Record>
The error message I encountered reads:
Error:(245, 38) TS2345:Argument of type '(row: Record) => <T>(obj: any) => T' is not assignable to parameter of type '(a: Record) => string'.
Type '<T>(obj: any) => T' is not assignable to type 'string'.
Error:(246, 31) TS2683:'this' implicitly has type 'any' because it does not have a type annotation.
UPDATE: I decided to simplify the 'keyof' type and just assigned groupBy as a string. Even though I don't believe these were my actual errors, IntelliJ had trouble updating its messages, so it's unclear. In any case, the issues seem to have disappeared now.