Skip to content

Commit

Permalink
[Fabric] Add a React Package that will load the ViewManager
Browse files Browse the repository at this point in the history
  • Loading branch information
cortinico committed Feb 28, 2022
1 parent c893370 commit 8afa19e
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.facebook.soloader.SoLoader;
import com.rnnewarchitectureapp.components.AnswerViewerManager;
import com.rnnewarchitectureapp.modules.MainApplicationTurboModuleManagerDelegate;
import com.rnnewarchitectureapp.modules.NativeAnswerSolver;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -83,6 +86,22 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
};
}
});
packages.add(new ReactPackage() {
@NonNull
@Override
public List<NativeModule> createNativeModules(
@NonNull ReactApplicationContext reactContext) {
return Collections.emptyList();
}

@NonNull
@Override
public List<ViewManager> createViewManagers(
@NonNull ReactApplicationContext reactContext) {
// Your ViewManager is returned here.
return Collections.singletonList(new AnswerViewerManager());
}
});
return packages;
}

Expand Down

0 comments on commit 8afa19e

Please sign in to comment.