Skip to content

Commit c2fa3fd

Browse files
committed
initialize using TurboModule
1 parent e01591c commit c2fa3fd

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

package/android/src/main/java/com/margelo/rnquicksqlite/RNQuickSQLiteInitModule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public String getName() {
1919
@Override
2020
public boolean install() {
2121
try {
22-
System.loadLibrary("RNQuickSQLite");
2322
QuickSQLiteBridge.instance.install(getReactApplicationContext());
2423
return true;
2524
} catch (Exception exception) {

package/src/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/prefer-optional-chain */
12
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
23
/* eslint-disable no-var */
34
/* eslint-disable @typescript-eslint/no-unsafe-argument */
@@ -16,19 +17,12 @@ declare global {
1617
}
1718

1819
if (global.__QuickSQLiteProxy == null) {
19-
if (RNQuickSQLiteInit == null) {
20+
if (RNQuickSQLiteInit == null || RNQuickSQLiteInit.install == null) {
2021
throw new Error(
2122
'QuickSQLite TurboModule not found. Maybe try rebuilding the app.'
2223
)
2324
}
2425

25-
// Check if we are running on-device (JSI)
26-
if (global.nativeCallSyncHook == null || RNQuickSQLiteInit.install == null) {
27-
throw new Error(
28-
'Failed to install react-native-quick-sqlite: React Native is not running on-device. QuickSQLite can only be used when synchronous method invocations (JSI) are possible. If you are using a remote debugger (e.g. Chrome), switch to an on-device debugger (e.g. Flipper) instead.'
29-
)
30-
}
31-
3226
// Call the synchronous blocking install() function
3327
const result = RNQuickSQLiteInit.install()
3428
if (result !== true) {

0 commit comments

Comments
 (0)