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
exportconstDatePicker=<IsClearableextendsboolean>({
value, onChange, isClearable
}: {value: string|undefinedonChange: (value: IsClearableextendstrue ? string|undefined : string,)=>void;isClearable?: IsClearable;})=>(<><div>{value ?? "Choose"}</div>// In an ideal world this one would works, but that's not the biggest issue{value&&isClearable&&<buttononClick={()=>onChange(undefined!)}>Clear</button>}// This one seems more like a bug<inputtype="date"onChange={e=>onChange(e.target.value)}/></>);
Expected behavior: No error
Actual behavior: Argument of type 'string' is not assignable to parameter of type 'IsClearable extends true ? string | undefined : string'
The text was updated successfully, but these errors were encountered:
TypeScript Version: 4.0.5, 4.1-beta, 4.2.0-dev
Search Terms: TS2345 conditional generic
Code: (Playground Link)
Expected behavior: No error
Actual behavior: Argument of type 'string' is not assignable to parameter of type 'IsClearable extends true ? string | undefined : string'
The text was updated successfully, but these errors were encountered: