diff --git a/docs/NativeComponentsAndroid.md b/docs/NativeComponentsAndroid.md index 463a3b52b6c4dd..5d0a96e2fc8087 100644 --- a/docs/NativeComponentsAndroid.md +++ b/docs/NativeComponentsAndroid.md @@ -144,7 +144,24 @@ class MyCustomView extends View { } ``` -The event name `topChange` maps to the `onChange` callback prop in JavaScript (mappings are in `UIManagerModuleConstants.java`). This callback is invoked with the raw event, which we typically process in the wrapper component to make a simpler API: +To map the `topChange` event name to the `onChange` callback prop in JavaScript, register it by overriding the `getExportedCustomBubblingEventTypeConstants` method in your `ViewManager`: + +```java +public class ReactImageManager extends SimpleViewManager { + ... + public Map getExportedCustomBubblingEventTypeConstants() { + return MapBuilder.builder() + .put( + "topChange", + MapBuilder.of( + "phasedRegistrationNames", + MapBuilder.of("bubbled", "onChange"))) + .build(); + } +} +``` + +This callback is invoked with the raw event, which we typically process in the wrapper component to make a simpler API: ```js // MyCustomView.js