问题
Is this possible?
I'd like to use one <Admin
to display other imported <Admin
components. I'm hoping to do something like this where MyTool
is an imported <Admin
component:
<Admin layout={MyLayout}
dataProvider={myDataProvider}
customRoutes={[
<Route
exact
path="/tools"
component={(props) => <MyTool {...props} />}/>
]}>
</Admin>
回答1:
I did try wrapping each <Admin
in my own Provider without any success so I'm considering Francois Z. answer to be definitive.
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
来源:https://stackoverflow.com/questions/60218084/how-to-embed-one-react-admin-component-inside-another-multiple-admin-components