How do I get the Exclusive Member from a Union Typescript?
selectedQueueItems: Array< TestA | TestB > = [];
TestA has a class member called Food, that TestB does not have. However most of the other class members are similar between each.
Receiving Error:
Property 'Food' does not exist on type 'TestA | TestB'.
Property 'Food' does not exist on type 'TestB'
Currently working with existing design in our code base.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…