react-native-sqlite-storage
react-native-sqlite-storage copied to clipboard
TypeError: Cannot read properties of undefined (reading 'open')
I'm stuck on using react-native-sqlite-storage, whenever I start initially open a new database as was mentioned in the documentation usage, I get this error: TypeError: Cannot read properties of undefined (reading 'open').
this is my code so far.
import React, {useEffect} from 'react'; import {View, Text} from 'react-native'; import SQLite from 'react-native-sqlite-storage';
const App = () => { try { SQLite.openDatabase({name: 'UserDatabase', location: 'default'}); } catch (error) { console.log(error); }
return ( <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> <Text>SQLite Database Example</Text> </View> ); };
export default App;
any solutions for this ?
Please write code as:
```js <Your code here> ```
This will post it in a code block with javascript syntax highlighting and make it much easier to read
Additionally, when making react native issues, please provide which device type you're experiencing the issue on. I'm guessing Windows, and if so, have you found my pull request which fixes this?
Additionally, this repo is dead, and I think I might be the only person still answering questions here.
Do you know about any alternatives @MacKenzieHnC for sqlite and react native?