【问题标题】:How to embed one React-Admin component inside another; multiple Admin components如何将一个 React-Admin 组件嵌入到另一个组件中;多个管理组件
【发布时间】:2020-05-29 18:23:56
【问题描述】:

这可能吗? 我想使用一个<Admin 来显示其他导入的<Admin 组件。我希望做这样的事情,其中​​MyTool 是一个导入的<Admin 组件:

    <Admin layout={MyLayout}
           dataProvider={myDataProvider}
           customRoutes={[
               <Route
                   exact
                   path="/tools"
                   component={(props) => <MyTool {...props} />}/>

           ]}>
    </Admin>

【问题讨论】:

  • react-admin 维护者:这从来都不是 react-admin 的要求,我也从未测试过。它可能行不通,我个人认为这是个坏主意。

标签: react-admin


【解决方案1】:

我确实尝试将每个 &lt;Admin 包装在我自己的 Provider 中但没有任何成功,所以我认为 Francois Z. 的答案是确定的。

react-admin maintainer here: this has never been a requirement of react-admin, and I've never tested it. It probably won't work, and I personally think it's a bad idea. – François Zaninotto 5 hours ago

【讨论】:

    猜你喜欢
    • 2022-10-04
    • 2021-07-03
    • 2019-03-03
    • 1970-01-01
    • 2019-02-26
    • 1970-01-01
    • 2018-05-07
    • 1970-01-01
    • 2020-12-06
    相关资源
    最近更新 更多