Skip to content

Commit

Permalink
Refactor to reuse EmptyReactNativeConfig from ReactNativeConfig
Browse files Browse the repository at this point in the history
Summary:
Quick refactor to reuse EmptyReactNativeConfig from ReactNativeConfig

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D34283060

fbshipit-source-id: 32400d5ed6defd9f82953dc49ae365598db71bbc
  • Loading branch information
mdvacca authored and facebook-github-bot committed Feb 28, 2022
1 parent be9cf17 commit 858ccfc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
Expand Up @@ -23,28 +23,7 @@
@DoNotStrip
public interface ReactNativeConfig {

public final ReactNativeConfig DefaultValuesReactNativeConfig =
new ReactNativeConfig() {
@Override
public boolean getBool(@NonNull String param) {
return false;
}

@Override
public long getInt64(@NonNull String param) {
return 0;
}

@Override
public String getString(@NonNull String param) {
return null;
}

@Override
public double getDouble(@NonNull String param) {
return 0;
}
};
public final ReactNativeConfig DefaultValuesReactNativeConfig = new EmptyReactNativeConfig();

/**
* Get a boolean param by string name. Default should be false.
Expand Down
Expand Up @@ -171,7 +171,6 @@ public JSIModuleProvider<UIManager> getJSIModuleProvider() {
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
// TODO: T71362667 add ReactNativeConfig's support in RNTester
ReactNativeConfig.DefaultValuesReactNativeConfig,
viewManagerRegistry);
}
Expand Down
Expand Up @@ -16,7 +16,6 @@
import com.facebook.react.bridge.UIManager;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.EmptyReactNativeConfig;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.helloworld.BuildConfig;
Expand Down Expand Up @@ -105,7 +104,7 @@ public JSIModuleProvider<UIManager> getJSIModuleProvider() {
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
new EmptyReactNativeConfig(),
ReactNativeConfig.DefaultValuesReactNativeConfig,
viewManagerRegistry);
}
});
Expand Down

0 comments on commit 858ccfc

Please sign in to comment.