Ошибка
index.js:1437 TypeError: _services_indexDB__WEBPACK_IMPORTED_MODULE_7__.default.export is not a function
in SaveAndLoad (created by WithStyles(SaveAndLoad))
in WithStyles(SaveAndLoad) (created by Route)
in Route (at App.js:94)
in App (created by Route)
in Route (created by withRouter(App))
in withRouter(App) (at src/index.js:10)
Код
import React from 'react';
import {withStyles} from "@material-ui/core/styles"
import PropTypes from 'prop-types';
import Dexie from "dexie";
import {importDB, exportDB, importInto} from "dexie-export-import";
import db from "../../services/indexDB";
/*
let indexedDB = new Dexie("WorkflowMagicUserDB");
indexedDB.version(1).stores({
workflows:"++id,client_id,content,title",
clients:"++id,name",
calendar_events:"++id,start,end,title,description,client_name,client_id,group_id",
calendar_event_group_id:"++id, title, client_name, client_id",
user:"user_id"
});
export default indexedDB
*/
import saveAndLoadStyle from '../../PageComponents/SaveAndLoad/style'
function SaveAndLoad(props){
async function getDB() {
try {
const blob = await db.export({ prettyJson: true });
} catch (error) {
console.error('' + error);
}
};
getDB()
return (
<div>
some content
</div>
)
}
SaveAndLoad.propTypes ={
classes:PropTypes.object.isRequired,
}
const styles = theme => (saveAndLoadStyle(theme));
export default withStyles(styles)(SaveAndLoad);