我有现有的小型React应用程序。我试图将react-admin添加到路由器文件中,但是当我尝试打开react-admin页面时出现错误元素类型无效
Router.js:
class Main extends Component {
render() {
return (
<BrowserRouter>
<div className="content">
<Route path exact = "/" component={Root}/>
<Route path = "/admin" component={App}/>
</div>
</BrowserRouter>
);
}
}
App.js Admin
import { createBrowserHistory as createHistory } from 'history';
const history = createHistory();
const AdminPage = () => {
return (
<Admin dataProvider={dataProvider}
dashboard={NewDash}
title={"Vendomat Admin"}
history={history}
catchAll>
<Resource name="equipments" list={EquipmentList} edit={EquipmentEdit} create={EquipmentCreate}
icon={EquipIcon} options={{label: 'equipments'}}/>
</Admin>
)
};
我遇到错误元素类型无效:预期使用字符串(对于内置组件)或类/函数(对于复合组件),但得到:布尔值。