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
Type inference gets that my field is currently of dropdown type
Actual behavior:
It doesn't
Related Issues:
Code
exporttypeDynamicFieldType={visibleTo: "EVERYONE"|"EMPLOYEE"|"EMPLOYER";shouldBeVisibleTo: "EVERYONE"|"EMPLOYEE"|"EMPLOYER";name: string;isRequired: boolean;value: string;defaultValue: string;labels: {NL: string;EN: string;};onChange: (name: string,value: string)=>void;};exporttypeDropdownType=DynamicFieldType&{type: "dropdown";options: string[];};exporttypeUploadType=DynamicFieldType&{type: "upload";};exporttypeCheckboxType=DynamicFieldType&{type: "checkbox";};exporttypeRadioType=DynamicFieldType&{type: "radio";options: string[];};exporttypeTextType=DynamicFieldType&{type: "text";};exportinterfaceDynamicFieldProps{field: DropdownType|UploadType|CheckboxType|RadioType|TextType;intl: any;// TODO: update react-intl for types}consthandleField=({ field }: DynamicFieldProps): void=>{switch(field.type){case"dropdown":
constfoo=field.options;console.log("Success!");}};constfailingHandleField=({ field }: DynamicFieldProps): void=>{const{ type }=field;switch(type){case"dropdown":
constfoo=field.options;console.log("It suddenly doesn't get it.");}};
Output
consthandleField=({ field })=>{switch(field.type){case"dropdown":
constfoo=field.options;console.log("Success!");}};constfailingHandleField=({ field })=>{const{ type }=field;switch(type){case"dropdown":
constfoo=field.options;console.log("It suddenly doesn't get it.");}};
TypeScript Version: Nightly
Search Terms:
Expected behavior:
Type inference gets that my field is currently of dropdown type
Actual behavior:
It doesn't
Related Issues:
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: