Skip to content

Stop passing getApplicationContext() in to the constructor #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new FirestackPackage(getApplicationContext())
new FirestackPackage()
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
public class FirestackPackage implements ReactPackage {
private Context mContext;

public FirestackPackage(Context ctx) {
mContext = ctx;
public FirestackPackage() {
}
/**
* @param reactContext react application context that can be used to create modules
Expand All @@ -26,7 +25,7 @@ public FirestackPackage(Context ctx) {
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();

modules.add(new FirestackModule(reactContext, mContext));
modules.add(new FirestackModule(reactContext, reactContext.getBaseContext()));
modules.add(new FirestackAuthModule(reactContext));
modules.add(new FirestackDatabaseModule(reactContext));
modules.add(new FirestackAnalyticsModule(reactContext));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"project": "ios/Firestack.xcodeproj"
},
"android": {
"packageInstance": "new FirestackPackage(getApplicationContext())"
"packageInstance": "new FirestackPackage()"
}
},
"devDependencies": {
Expand Down