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
<SelectListonChange={(option)=>{console.log(option.value);// "value" does not exist on type unknown}}options={[1,2,3].map((item)=>({label: item,value: item}))}/>
What was expected to happen?
Current behavior is to type options as unknown[], and option arg in onChange callback as unknown.
It leads to unnecessary casting. Moreover, the shape of option is actually expected to be { label: string, value: string }, the component won't work otherwise.
I would expect the option's type to extend { label: string, value: string } and to be inferred from the list of provided options
@freenow/wave
version: 1.30.0Relevant code
What was expected to happen?
Current behavior is to type
options
asunknown[]
, andoption
arg inonChange
callback asunknown
.It leads to unnecessary casting. Moreover, the shape of
option
is actually expected to be{ label: string, value: string }
, the component won't work otherwise.I would expect the option's type to extend
{ label: string, value: string }
and to be inferred from the list of provided optionsReproduction
https://codesandbox.io/s/wave-playground-4537vt?file=/src/App.tsx
The text was updated successfully, but these errors were encountered: