I am getting the following error:
Argument of type
'(item: ItemType) => void'
is not assignable too parameter.
I can't seem to understand what's going on.
type MainProps = {
book: Array<Object>;
setFirstAction: (found: Array<Object>) => Array<Object>;
}
type ItemType = {
volumeInfo: Object;
}
class Main extends Component<MainProps, {}> {
render() {
const { book } = this.props
const books = book?.map((item: ItemType) => {
//right here
console.log(item.volumeInfo);
})
// console.log(book)
return (
<div className="wrapper">
</div>
)
}
}