react-native-sqlite-storage icon indicating copy to clipboard operation
react-native-sqlite-storage copied to clipboard

TypeError: Cannot read properties of undefined (reading 'open')

Open AhmedMustafa505 opened this issue 1 year ago • 2 comments

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 ?

AhmedMustafa505 avatar Aug 08 '23 07:08 AhmedMustafa505

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.

MacKenzieHnC avatar Aug 14 '23 19:08 MacKenzieHnC

Do you know about any alternatives @MacKenzieHnC for sqlite and react native?

amiellion avatar Oct 16 '23 04:10 amiellion