Closed tw0po1nt closed 1 year ago
@tw0po1nt onValueChange
will only return value
as string. and label
only use for UI show to user.
This time, this library not support for your case. And I have no more time to fix for your case.
In the future if I have time I will be back and also support value other type than string. (This time only string)
Documentation is not clear, too. (I will edit note for other for this time.) I am not sure when I free from other work to support this.
Pull request are also welcome,
:)
One more thing It will also affect selectedValue
prop.
I did find a workaround, which is good. Essentially, I just search my data source for the value passed to the callback, and then update my state backing the selectedValue. If I have some time this weekend, I'll see about implementing the behavior I proposed in the initial issue, and opening a PR. Would gladly contribute!
I am using this project with TypeScript, and it works well, but there is one problem that is slightly annoying:
I have the following:
I expect the
value
param passed toonValueChange
to be of typeTimeSlot
and indeed, the checker tells me it is. But when Iconsole.log(value)
, I get a string"2022-07-13T19:00:22.730Z"
instead of{"label": "14:00", "value": "2022-07-13T19:00:22.730Z"}
This seems like either a bug or a documentation issue. But the type checker would make me believe it should work like I have it above, but it isn't.