Closed shirakaba closed 4 years ago
Very satisfied with event handling and typings for event handlers in React NativeScript now, thanks to https://github.com/halfnelson/nativescript-source-to-jsx-def and NativeScript Vue's DOM interface that handles event listener attachment/removal very elegantly:
The abstract
<RCTView>
(I need to rename it to<$View>
for consistency...) class component takes in props foronLoaded
and other events. Although they indeed belong to the NativeScriptView
component, some of the event names (loadedEventName
andunloadedEventName
, at first glance) also seem to be registered onViewBase
.https://github.com/shirakaba/react-nativescript/blob/master/react-nativescript/src/components/View.ts#L23
https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/ui/core/view-base/view-base.d.ts#L209
https://github.com/NativeScript/NativeScript/blob/master/nativescript-core/ui/core/view/view.d.ts#L515
I don't know whether this means that ViewBase also supports its own
onLoaded
andonUnloaded
events, but either way, it shall need looking into.