在此link
之后,我尝试将React Admin页面与ElectronJS应用程序集成成功与示例React Admin页面集成并呈现
正在运行的示例React Admin页面示例。
import React from 'react';
import { Admin, Resource, ListGuesser } from 'react-admin';
import jsonServerProvider from 'ra-data-json-server';
const dataProvider = jsonServerProvider('http://jsonplaceholder.typicode.com');
const App = () => (
<Admin dataProvider={dataProvider}>
<Resource name="users" list={ListGuesser} />
</Admin>
);
export default App;
但是之后,我尝试了自己的包含
的自定义页面react-admin-loopback
错误页面
import React from 'react';
import { Admin, Resource, ListGuesser } from 'react-admin';
import loopbackClient from 'react-admin-loopback';
const App = () => (
<Admin dataProvider={loopbackClient(`https://example.com/api`)}>
<Resource list={ListGuesser} />
</Admin>
);
export default App;
我正面临如下问题
> ReferenceError: regeneratorRuntime is not defined
> at C:\Users\Valuesoft\Desktop\electrate-master\electrate-master\node_modules\react-admin-loopback\lib\fetch.js:20:46
> at Object.<anonymous> (C:\Users\Valuesoft\Desktop\electrate-master\electrate-master\node_modules\react-admin-loopback\lib\fetch.js:81:2)
> at Object.<anonymous> (C:\Users\Valuesoft\Desktop\electrate-master\electrate-master\node_modules\react-admin-loopback\lib\fetch.js:92:3)
> at Module._compile (internal/modules/cjs/loader.js:808:30)
> at Object.Module._extensions..js (internal/modules/cjs/loader.js:820:10)
> at Module.load (internal/modules/cjs/loader.js:677:32)
> at tryModuleLoad (internal/modules/cjs/loader.js:609:12)
> at Function.Module._load (internal/modules/cjs/loader.js:601:3)
> at Module.require (internal/modules/cjs/loader.js:715:19)
> at require (internal/modules/cjs/helpers.js:14:16)
如何解决这个问题?
致谢。