I have an object property with the following signature.
handleItem = (data: Output & { isValid: boolean }) => {}
I do not understand the & part.
Basically I trying to pass some arguments as:
handleItem (outputItem, { isValid: false })
and I receive an error
Expected 1 arguments, but got 2.'
How to pass values property? How the & is used in this instance?
& { isValid: boolean }is describing thedata: Outputpart. This makes sense, considering there should be one argument.:is a type annotation. The function only takes a single object as argument. (And that object needs to contain anisValidproperty.)