Skip to content

Commit beb99cb

Browse files
authored
Merge pull request #89 from mikelambert/master
Stop passing getApplicationContext() in to the constructor
2 parents 50205af + 1efb5ba commit beb99cb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public class MainApplication extends Application implements ReactApplication {
149149
protected List<ReactPackage> getPackages() {
150150
return Arrays.<ReactPackage>asList(
151151
new MainReactPackage(),
152-
new FirestackPackage(getApplicationContext())
152+
new FirestackPackage()
153153
);
154154
}
155155
};

android/src/main/java/io/fullstack/firestack/FirestackPackage.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
public class FirestackPackage implements ReactPackage {
1616
private Context mContext;
1717

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

29-
modules.add(new FirestackModule(reactContext, mContext));
28+
modules.add(new FirestackModule(reactContext, reactContext.getBaseContext()));
3029
modules.add(new FirestackAuthModule(reactContext));
3130
modules.add(new FirestackDatabaseModule(reactContext));
3231
modules.add(new FirestackAnalyticsModule(reactContext));

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"project": "ios/Firestack.xcodeproj"
4848
},
4949
"android": {
50-
"packageInstance": "new FirestackPackage(getApplicationContext())"
50+
"packageInstance": "new FirestackPackage()"
5151
}
5252
},
5353
"devDependencies": {

0 commit comments

Comments
 (0)