You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a specific type that guarantees only unions from a generic type that could be mixed-bag.
typeMemberInfo={first_name: string;last_name: string;date_of_birth: number;favourite_fruit: 'apple'|'mango'|'banana';industry: 'tech'|'art'|'medicine';}typeChoiceBasedField={[KinkeyofMemberInfo]: IsUnion<MemberInfo[K]>extendstrue ? K : never}[keyofRespondentFields];// can accept 'favourite_fruit' or 'industry', but errors on anything elseconstrenderDropdown=(field: ChoiceBasedField)=>(<select> ... </select>);
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
The funding will be given to active contributors.
Thank you in advance for helping prioritize & fund our backlog.
The text was updated successfully, but these errors were encountered:
Inspired by - https://stackoverflow.com/a/53955431/5039290
Use case
Create a specific type that guarantees only unions from a generic type that could be mixed-bag.
Upvote & Fund
The text was updated successfully, but these errors were encountered: