Add missing NativeEventListener methods to NativeDevSettings (#27838)

Summary:
Since migrating to Turbomodules (8fe04cf) the addMenuItem method crashes because the NativeEventListener methods are missing from the codegen flow type. Added the same methods based on what we do in AppState which is another native module that extends NativeEventListener.

## Changelog

[Internal] [Fixed] - Add missing NativeEventListener methods to NativeDevSettings
Pull Request resolved: https://github.com/facebook/react-native/pull/27838

Test Plan:
|Before|After|
|{F226978596}|{F226978628}

Differential Revision: D19518474

Pulled By: PeteTheHeat

fbshipit-source-id: acddba9f18dd558df1d6df78b539689fdfd0062f
This commit is contained in:
Janic Duplessis
2020-01-23 13:19:04 -08:00
committed by Facebook Github Bot
parent e6f3388541
commit d72e078df4
5 changed files with 36 additions and 0 deletions
@@ -30,6 +30,9 @@ public abstract class NativeDevSettingsSpec extends ReactContextBaseJavaModule i
public void onFastRefresh() {
}
@ReactMethod
public abstract void removeListeners(double count);
@ReactMethod
public abstract void reload();
@@ -51,4 +54,7 @@ public abstract class NativeDevSettingsSpec extends ReactContextBaseJavaModule i
@ReactMethod
public abstract void setIsShakeToShowDevMenuEnabled(boolean enabled);
@ReactMethod
public abstract void addListener(String eventName);
}
@@ -108,4 +108,14 @@ public class DevSettingsModule extends NativeDevSettingsSpec {
public void setIsShakeToShowDevMenuEnabled(boolean enabled) {
// iOS only
}
@Override
public void addListener(String eventName) {
// iOS only
}
@Override
public void removeListeners(double count) {
// iOS only
}
}