react-admin-import-csv
CSV import button for react-admin.
Usage
Simply import the button into a toolbar, like so:
Basic Import Action Only
;;;const ListActions = {const className basePath = props;return<TopToolbar className=className><CreateButton basePath=basePath /><ImportButton ...props /></TopToolbar>;};const PostList =<List ...props filters=<PostFilter /> actions=<ListActions />><Datagrid><TextField source="title" /><RichTextField source="body" />...</Datagrid></List>;
Export/Import Actions
;;;const ListActions = {constclassNamebasePathtotalresourcecurrentSortfilterValuesexporter} = props;return<TopToolbar className=className><CreateButton basePath=basePath /><ExportButtondisabled=total === 0resource=resourcesort=currentSortfilter=filterValuesexporter=exporter/><ImportButton ...props /></TopToolbar>;};const PostList =<List ...props filters=<PostFilter /> actions=<ListActions />><Datagrid><TextField source="title" /><RichTextField source="body" />...</Datagrid></List>;
Configuration Options
// All configurations are optional}ImportButton /
Development
If you'd like to develop on react-admin-import-csv
do the following.
Local install
git clone https://github.com/benwinding/react-admin-import-csv/
cd react-admin-import-csv
yarn
Tests
yarn test # in root folder
Run demo
Open another terminal
yarn build-watch
Open another terminal and goto the demo
folder
yarn start