Skip to content

Instantly share code, notes, and snippets.

@dilipsuthar97
Created May 11, 2020 08:31
Show Gist options
  • Save dilipsuthar97/fb12caf97e77b512cbd580e2882b7aa8 to your computer and use it in GitHub Desktop.
Save dilipsuthar97/fb12caf97e77b512cbd580e2882b7aa8 to your computer and use it in GitHub Desktop.
Android Native Module wrapper for ReactNative -MyLibraryPackage.java
package com.reactlibrary;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
public class MyLibraryPackage implements ReactPackage {
@NonNull
@Override
public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new MyLibraryModule(reactContext));
return modules;
}
@NonNull
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment