Reputation: 1
I am creating a custom List component by referring to admin-on-rest List component. I imported all modules from admin-on-rest. But few modules are not getting imported and giving an error like queryreducer,removeKey ...
What is the correct way of importing modules from admin-on-rest?
i tried importing all modules at one place. Also tried importing default and others separate
admin-on-rest version : "1.2.3"
I tried this way :
import {
queryReducer,
SET_SORT,
SET_PAGE,
SET_FILTER,
SORT_DESC,
ViewTitle,
Title,
DefaultPagination,
DefaultActions,
crudGetList as crudGetListAction,
changeListParams as changeListParamsAction,
removeKey,
defaultTheme
} from "admin-on-rest";
and also this way :
import { SET_SORT, SET_PAGE, SET_FILTER, SORT_DESC } from "admin-on-rest";
import { queryReducer } from "admin-on-rest";
import { ViewTitle } from "admin-on-rest";
import Title from "admin-on-rest";
import DefaultPagination from "admin-on-rest";
import DefaultActions from "admin-on-rest";
import { crudGetList as crudGetListAction } from "admin-on-rest";
import { changeListParams as changeListParamsAction } from "admin-on-rest";
import translate from "admin-on-rest";
import { removeKey } from "admin-on-rest";
import defaultTheme from "admin-on-rest";
The output error :
Uncaught TypeError: webpack_require.i(...) is not a function
Upvotes: 0
Views: 49
Reputation: 1
I made it working by importing like this. Just specify the exact path.
import {
SET_SORT,
SET_PAGE,
SET_FILTER,
SORT_DESC
} from "admin-on-rest/lib/reducer/resource/list/queryReducer";
import queryReducer from "admin-on-rest/lib/reducer/resource/list/queryReducer";
import removeKey from "admin-on-rest/lib/util/removeKey";
Upvotes: 0