Closed kapilpipaliya closed 2 years ago
The conditional check prevents errors later on. An undefined
value is not a valid value to call setValue()
against. Changing that would introduce more complexity for cases like multiple
, where setValue
would expect an array.
However, I think I can safely do the check in the Select
component instead (and only actually call setValue
when it is not undefined
).
Released in 0.12.0
Aside: in your example you don't need to explicitly change initialValue
on every change - the component manages updating its internal value for you.
when i have initialValue is undefined
when initialValue is changed Select is not updated.
why you only apply createEffect when only initialValue is there? https://github.com/thisbeyond/solid-select/blob/main/src/select.tsx#L65