How to solve error TS7031: Binding element 'id' implicitly has an 'any' type.

 This error occurred in my Angular app fetching IDS from an observable. 

Solution

Changed the line from:

const ids = this.userService.userBooks$.value.map(({ id }) => id);

to:

const ids = this.userService.userBooks$.value.map(({ id }: {id: any}) => id);

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!