Type to require elements of array to all have one property or the other
I'm looking for a type that will force all elements of the array to have 1 property or the other
example
so here I need two things
1. one column can't have both
weight
and width
2. all columns in the array should have the same property (weight or width)3 Replies
does the above not work? hmm
you need to assign the other prop as never
TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.