React-admin-readme-2.jsx
· 473 B · react
Brut
// in app.js
import * as React from "react";
import { render } from 'react-dom';
import { Admin, Resource } from 'react-admin';
import restProvider from 'ra-data-simple-rest';
import { PostList, PostEdit, PostCreate, PostIcon } from './posts';
render(
<Admin dataProvider={restProvider('http://localhost:3000')}>
<Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} />
</Admin>,
document.getElementById('root')
);
1 | // in app.js |
2 | import * as React from "react"; |
3 | import { render } from 'react-dom'; |
4 | import { Admin, Resource } from 'react-admin'; |
5 | import restProvider from 'ra-data-simple-rest'; |
6 | |
7 | import { PostList, PostEdit, PostCreate, PostIcon } from './posts'; |
8 | |
9 | render( |
10 | <Admin dataProvider={restProvider('http://localhost:3000')}> |
11 | <Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} /> |
12 | </Admin>, |
13 | document.getElementById('root') |
14 | ); |