I am trying to update an item from a list of items using map in ReactJs (with TypeScript). But cannot find the issue.
const [orderList, setOrderList] = useState([])
...
setOrderList( orderList.map( order:any => {
if( order.id == orderId)
return {...order, review_id:1}
return order
}))
the following typescript hint is showing:
Argument of type 'any[]' is not assignable to parameter of type 'SetStateAction<never[]>'.
Type 'any[]' is not assignable to type 'never[]'.
Type 'any' is not assignable to type 'never'.ts(2345)
Thanks in advance