Loopback Client for react-admin
For using Loopback 3 with react-admin.
Installation
npm install --save react-admin-loopback
Prerequisite
- Your loopback server must response
Content-Range
header when querying list. Please use loopback-content-range on your server end.
Usage
// in src/App.js;;;; ;;; const BookList = <List ...props> <Datagrid> <ShowButton /> <EditButton /> <TextField source="author" /> <NumberField source="count" /> </Datagrid> </List>;const BookShow = <Show ...props> <SimpleShowLayout> <TextField source="author" /> <NumberField source="count" /> </SimpleShowLayout> </Show>;const BookEdit = <Edit ...props> <SimpleForm> <DisabledInput source="id" /> <TextInput source="author" /> <NumberInput source="count" /> </SimpleForm> </Edit>;const BookCreate = <Create ...props> <SimpleForm> <TextInput source="author" /> <NumberInput source="count" /> </SimpleForm> </Create>;const App = <Admin dataProvider= authProvider=> <Resource name="books" show=BookShow create=BookCreate edit=BookEdit list=BookList /> </Admin>; ;
The dataProvider supports include:
// dataProvider.js; const dataProvider = ; ;
; ... ; ...
License
This library is licensed under the MIT Licence.