I am dealing with an object that can have a type of WithBalance | WithoutBalance
withBalance : { balance:number, name:string } withoutBalance : { name : string}
<span>{{object?.balance ?? 0}} </span>
However, when I attempt to access the balance property, I encounter the error message:
Property 'balance' does not exist on type WithoutBalance
.
Any suggestions on how to resolve this issue?