File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
android/src/main/java/com/reactnativecommunity/picker Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,17 @@ public void dispatch(RCTEventEmitter rctEventEmitter) {
21
21
rctEventEmitter .receiveEvent (getViewTag (), getEventName (), getEventData ());
22
22
}
23
23
24
- private WritableMap getEventData () {
24
+ /**
25
+ * In RN version 0.65+ getEventData method is introduced
26
+ * https://github.com/facebook/react-native/commit/72d0ddc16f2f631003c3486e0a59e50c145ec613
27
+ *
28
+ * In order to keep compatibility with 0.65+ and not introduce breaking change for that lib,
29
+ * the only change is changing access modifier from `private` to `protected` without using @override annotation
30
+ * (idk if it will not bring any "method is hidden, but should overriden" warning, but for now it just works)
31
+ *
32
+ * In future versions, where `dispatch` method will be removed, there will be need to make a breaking change here
33
+ */
34
+ protected WritableMap getEventData () {
25
35
WritableMap eventData = Arguments .createMap ();
26
36
eventData .putInt ("target" , getViewTag ());
27
37
return eventData ;
Original file line number Diff line number Diff line change @@ -21,7 +21,17 @@ public void dispatch(RCTEventEmitter rctEventEmitter) {
21
21
rctEventEmitter .receiveEvent (getViewTag (), getEventName (), getEventData ());
22
22
}
23
23
24
- private WritableMap getEventData () {
24
+ /**
25
+ * In RN version 0.65+ getEventData method is introduced
26
+ * https://github.com/facebook/react-native/commit/72d0ddc16f2f631003c3486e0a59e50c145ec613
27
+ *
28
+ * In order to keep compatibility with 0.65+ and not introduce breaking change for that lib,
29
+ * the only change is changing access modifier from `private` to `protected` without using @override annotation
30
+ * (idk if it will not bring any "method is hidden, but should overriden" warning, but for now it just works)
31
+ *
32
+ * In future versions, where `dispatch` method will be removed, there will be need to make a breaking change here
33
+ */
34
+ protected WritableMap getEventData () {
25
35
WritableMap eventData = Arguments .createMap ();
26
36
eventData .putInt ("target" , getViewTag ());
27
37
return eventData ;
You can’t perform that action at this time.
0 commit comments