Skip to content

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

Open
@AhmedMustafa505

Description

@AhmedMustafa505

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions