Реагировать попробуйте открыть базу данных - PullRequest
0 голосов
/ 27 сентября 2018

Реагируйте на родную, я пытаюсь открыть базу данных.Сначала я создал базу данных с именем проекта "exampledb.db".Я добавил оба «response-native-sqlite-storage» и «Reaction-native-sqlite3». Оба установлены и связаны.но мой код не работает.Я следую инструкции по этой ссылке https://github.com/andpor/react-native-sqlite-storage здесь мой код и изображение ошибки, пожалуйста, проверьте

   import React, {Component} from 'react';
    import {Platform, StyleSheet, Text, View} from 'react-native';
    import SQLite from 'react-native-sqlite-storage';

 const instructions = Platform.select({
      ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
      android:
        'Double tap R on your keyboard to reload,\n' +
        'Shake or press menu button for dev menu',
    });

    type Props = {};

    //var React = require('react-native');
    //var SQLite = require('react-native-sqlite-storage')

  export default class App extends Component<Props> {


      constructor(props) {
            super(props)


        this.openCB = this.openCB.bind(this);
        this.errorCB = this.errorCB.bind(this);
      }

      errorCB(err) {
        console.log("SQL Error: " + err);
      }

      successCB() {
        console.log("SQL executed fine");
      }

      openCB() {
        console.log("Database OPENED");
      }

      componentWillMount() {

        var db = SQLite.openDatabase("exampledb.db", "1.0", "Test Database", 200000, this.openCB, this.errorCB);
      }

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...