mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
@Nonnull annotation for ReactPackage (#23415)
Summary: Here are some leftovers from nullable annotations for native modules, discovered while developing native module in Kotlin. This will help improve Kotlin developer experience [Android] [Changed] - Add Nonnull annotations to ReactPackage Pull Request resolved: https://github.com/facebook/react-native/pull/23415 Differential Revision: D14064607 Pulled By: cpojer fbshipit-source-id: af2ce1fc1911ee03c54b20a4fc3a6d1aba9267da
This commit is contained in:
committed by
Facebook Github Bot
parent
e6320c6e75
commit
84f40da990
@@ -34,10 +34,12 @@ public interface ReactPackage {
|
||||
* @param reactContext react application context that can be used to create modules
|
||||
* @return list of native modules to register with the newly created catalyst instance
|
||||
*/
|
||||
@Nonnull
|
||||
List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext);
|
||||
|
||||
/**
|
||||
* @return a list of view managers that should be registered with {@link UIManagerModule}
|
||||
*/
|
||||
@Nonnull
|
||||
List<ViewManager> createViewManagers(@Nonnull ReactApplicationContext reactContext);
|
||||
}
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.facebook.react.modules.core;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import android.net.Uri;
|
||||
@@ -27,7 +28,7 @@ import com.facebook.react.module.annotations.ReactModule;
|
||||
public class DeviceEventManagerModule extends ReactContextBaseJavaModule {
|
||||
public static final String NAME = "DeviceEventManager";
|
||||
public interface RCTDeviceEventEmitter extends JavaScriptModule {
|
||||
void emit(String eventName, @Nullable Object data);
|
||||
void emit(@Nonnull String eventName, @Nullable Object data);
|
||||
}
|
||||
|
||||
private final Runnable mInvokeDefaultBackPressRunnable;
|
||||
|
||||
Reference in New Issue
Block a user