Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AhmedMustafa505 opened this issue Aug 8, 2023 · 2 comments
Open

Comments

@AhmedMustafa505
Copy link

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'}}>
SQLite Database Example

);
};

export default App;

any solutions for this ?

@MacKenzieHnC
Copy link

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.

@amiellion
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants