试图弄清楚如何从数据库中获取单个对象,我知道它的键,在 ReactJS 中。
import { db } from 'baqend';
componentWillMount() {
db.Companies.load('16747fce-f0b1-422b-aa60-220c2dccac58')
.then((response) => {
console.log(response);
});
}
我收到此错误:
TypeError: Cannot read property 'load' of undefined
EditCompany.componentWillMount
src/containers/EditCompany.js:33
30 | }
31 |
32 | componentWillMount() {
> 33 | db.Companies.load('16747fce-f0b1-422b-aa60-220c2dccac58')
34 | .then((response) => {
35 | console.log(response);
36 | });
我正在尝试直接在组件中执行此操作,但该项目正在使用 React Starter。这就像查看公司详细信息页面。