Reputation: 17
From some reason the code I write here build 2 tables and displaying both. I tried to re-write it many times and still displaying 2 tables.
results:
what should I try?
Upvotes: 1
Views: 638
Reputation: 7335
The <Admin>
component should only have <Resource>
components as children. Your <Users>
component should be passed as the list
prop of a resource:
const App = () =>
<Admin dataProvider={myDataProvider}>
<Resource list={Users} />
</Admin>;
This is well documented in https://marmelab.com/react-admin/Tutorial.html#mapping-api-endpoints-with-resources
Upvotes: 1
Reputation: 7293
It may be that you loaded the entire App
component twice. To test that you can try to render some string in the App
component. It could also be that Admin
renders Users
already.
Upvotes: 0