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
I was about to create another issue, but the topic is similar so trying here...
Why AndroidEvent does have the (undocumented, but very useful) type outside of nativeEvent? Is there any practical reason I am missing?
Could we imagine a transition with this type in nativeEvent data (with a deprecation period to ensure no brutal breaking change)?
Also, I didn't find the event type in the readme (except for neutralButtonPressed).
The most interesting (at least in my case) is "dismissed" value, especially if you think about having inline picker on iOS 13+ a classic modal for android (where you need to listen to dismiss (cancelled) event).
Why it is needed
I was about to update bindings for ReScript but the way nativeEvent are designed for ReScript (still named @reason-react-native/datepicker) make it not simple to update them for values outside of nativeEvent payload (I didn't say hard, I can do this but I doesn't feel right as all the lib I know use "custom data" inside nativeEvent.
Possible implementation
We could duplicate type inside nativeEvent (and keep it outside with a warning when accessed) to make it more normalized with a transition period.
Code sample
In practise, we could just use event.nativeEvent.type instead of event.type.
I am open to make this non immediately breaking change
The text was updated successfully, but these errors were encountered:
hello @MoOx,
sorry for taking a year to answer 😆
The reason type is included in the event is, as you pointed out, to distinguish what operation user performed on android.
It's true that the property is not documented, simply because I didn't do it for reasons explained in #313 and no one else did it, either.
However, the sponsorship situation of this package has been getting better and documentation improvements are coming :)
I cannot say why the type lives outside of nativeEvent because it was done this way before I got involved but if you believe the better place for it is in the nativeEvent then I'm open to merging a PR that does this in a non-breaking way :)
Feature request
I was about to create another issue, but the topic is similar so trying here...
type
outside of nativeEvent? Is there any practical reason I am missing?type
innativeEvent
data (with a deprecation period to ensure no brutal breaking change)?Also, I didn't find the event type in the readme (except for neutralButtonPressed).
The most interesting (at least in my case) is
"dismissed"
value, especially if you think about having inline picker on iOS 13+ a classic modal for android (where you need to listen to dismiss (cancelled) event).Why it is needed
I was about to update bindings for ReScript but the way nativeEvent are designed for ReScript (still named
@reason-react-native/datepicker
) make it not simple to update them for values outside ofnativeEvent
payload (I didn't say hard, I can do this but I doesn't feel right as all the lib I know use "custom data" inside nativeEvent.Possible implementation
We could duplicate
type
inside nativeEvent (and keep it outside with a warning when accessed) to make it more normalized with a transition period.Code sample
In practise, we could just use
event.nativeEvent.type
instead ofevent.type
.I am open to make this non immediately breaking change
The text was updated successfully, but these errors were encountered: