Skip to content

Commit b847f74

Browse files
committed
fix: linting errors
1 parent 1926e35 commit b847f74

File tree

7 files changed

+66
-1617
lines changed

7 files changed

+66
-1617
lines changed

examples/hybridexampleapp/.prettierrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/hybridexampleapp/README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

examples/hybridexampleapp/android/app/src/main/java/com/instabug/hybridsampleapp/ReactNativeAppActivity.java

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ protected void onCreate(Bundle savedInstanceState) {
2121
super.onCreate(savedInstanceState);
2222
SoLoader.init(this, false);
2323

24-
// Packages that cannot be autolinked yet can be added manually here, for example:
25-
// packages.add(new MyReactNativePackage());
26-
// Remember to include them in `settings.gradle` and `app/build.gradle` too.
24+
mReactRootView = new ReactRootView(this);
2725
List<ReactPackage> packages = new PackageList(getApplication()).getPackages();
26+
// Packages that cannot be autolinked yet can be added manually here, for example:
2827

29-
mReactRootView = new ReactRootView(this);
3028
mReactInstanceManager = ReactInstanceManager.builder()
3129
.setApplication(getApplication())
3230
.setCurrentActivity(this)
@@ -36,51 +34,59 @@ protected void onCreate(Bundle savedInstanceState) {
3634
.setUseDeveloperSupport(BuildConfig.DEBUG)
3735
.setInitialLifecycleState(LifecycleState.RESUMED)
3836
.build();
39-
40-
// The string here (e.g. "MyReactNativeApp") has to match
4137
// the string in AppRegistry.registerComponent() in index.js
42-
mReactRootView.startReactApplication(mReactInstanceManager, "HybridApp", null);
38+
mReactRootView.startReactApplication(mReactInstanceManager, "hybridexampleapp", null);
39+
4340
setContentView(mReactRootView);
4441
}
4542

4643
@Override
4744
public void invokeDefaultOnBackPressed() {
4845
super.onBackPressed();
4946
}
50-
5147
@Override
52-
protected void onPause() {
53-
super.onPause();
54-
if (mReactInstanceManager != null) {
55-
mReactInstanceManager.onHostPause(this);
56-
}
57-
}
48+
protected void onPause() {
49+
super.onPause();
5850

59-
@Override
60-
protected void onResume() {
61-
super.onResume();
62-
if (mReactInstanceManager != null) {
63-
mReactInstanceManager.onHostResume(this); // Corrected the method call
64-
}
51+
if (mReactInstanceManager != null) {
52+
mReactInstanceManager.onHostPause(this);
6553
}
54+
}
6655

67-
@Override
68-
protected void onDestroy() {
69-
super.onDestroy();
70-
if (mReactInstanceManager != null) {
71-
mReactInstanceManager.onHostDestroy(this);
72-
}
73-
if (mReactRootView != null) {
74-
mReactRootView.unmountReactApplication();
75-
}
56+
@Override
57+
protected void onResume() {
58+
super.onResume();
59+
60+
if (mReactInstanceManager != null) {
61+
mReactInstanceManager.onHostResume(this, this);
7662
}
63+
}
7764

78-
@Override
79-
public void onBackPressed() {
80-
if (mReactInstanceManager != null) {
81-
mReactInstanceManager.onBackPressed();
82-
} else {
83-
super.onBackPressed();
84-
}
65+
@Override
66+
protected void onDestroy() {
67+
super.onDestroy();
68+
69+
if (mReactInstanceManager != null) {
70+
mReactInstanceManager.onHostDestroy(this);
71+
}
72+
if (mReactRootView != null) {
73+
mReactRootView.unmountReactApplication();
74+
}
75+
}
76+
@Override
77+
public void onBackPressed() {
78+
if (mReactInstanceManager != null) {
79+
mReactInstanceManager.onBackPressed();
80+
} else {
81+
super.onBackPressed();
82+
}
83+
}
84+
@Override
85+
public boolean onKeyUp(int keyCode, KeyEvent event) {
86+
if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
87+
mReactInstanceManager.showDevOptionsDialog();
88+
return true;
8589
}
90+
return super.onKeyUp(keyCode, event);
91+
}
8692
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
presets: ['module:@react-native/babel-preset'],
2+
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: ['react-native-reanimated/plugin'],
34
};

examples/hybridexampleapp/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121
"@babel/preset-env": "^7.20.0",
2222
"@babel/runtime": "^7.20.0",
2323
"@react-native/babel-preset": "0.75.4",
24-
"@react-native/eslint-config": "0.75.4",
2524
"@react-native/metro-config": "0.75.4",
2625
"@react-native/typescript-config": "0.75.4",
2726
"@types/react": "^18.2.6",
2827
"@types/react-test-renderer": "^18.0.0",
2928
"babel-jest": "^29.6.3",
30-
"eslint": "^8.19.0",
3129
"jest": "^29.6.3",
3230
"prettier": "2.8.8",
3331
"react-test-renderer": "18.3.1",

examples/hybridexampleapp/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"compilerOptions": {
3-
"jsx": "react"
4-
},
52
"compilerOptions": {
63
"jsx": "react"
74
},

0 commit comments

Comments
 (0)