react searchkit with material-ui (pagination is-disabled)

倾然丶 夕夏残阳落幕 提交于 2019-12-11 06:54:13

问题


I have an issue with searchkit using with material-ui. Both of libraries needs reactjs, but different versions. First time, when i used only searchkit with react, my app worked good, with no errors and warnings. Then i connected material-ui to my app, and got warnings like so:

  • warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the insetSubheader prop on List. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.
  • warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the subheader prop on List. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.
  • warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the subheaderStyle prop on List. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.
  • warning.js:44 Warning: You are manually calling a React.PropTypes validation function for the linkButton prop on EnhancedButton. This is deprecated and will not work in the next major version. You may be seeing this warning due to a third-party PropTypes library.
  • Warning: Unknown prop labelColor on tag. Remove this prop from the element. in div (created by EnhancedButton) in EnhancedButton (created by Chip) in Chip (created by JobTitleComponent) in div (created by JobTitleComponent) in div (created by CardText) in CardText (created by JobTitleComponent) in div (created by Card) in div (created by Paper) in Paper (created by Card) in Card (created by JobTitleComponent) in div (created by JobTitleComponent) in div (created by JobTitleComponent) in JobTitleComponent (created by DescriptionComponent) in div (created by DescriptionComponent) in div (created by DescriptionComponent) in div (created by DescriptionComponent) in MuiThemeProvider (created by DescriptionComponent) in DescriptionComponent (created by FullDescription)

But the main thing, that searchkit pagination worked well. Versions of libraries that i used was

  • "material-ui": "0.15.2",
  • "react": "15.3.0"
  • "react-dom": "15.3.0"
  • "searchkit": "^0.10.0".

Then i updated all to the latest versions, and searchkit Pagination has disappeared. I still can see it in DOM, but component thinks, that there is only one page to show, and has class "is-disabled", amount of results is more than 100 and hitsPerPage={10} though. I tried to return to the previous versions of libraries and I've got the same warnings, but pagination is still disabled. How can i fix that issue ? Help me, please.


回答1:


So the issue was with regression with lodash. Developers advised to use lodash@4.13.1, and if you use webpack, do this: resolve: { alias: { react: path.resolve('./node_modules/react'), lodash: path.resolve('./node_modules/lodash') } }

Also they sad, they will fix that issue.



来源:https://stackoverflow.com/questions/38847307/react-searchkit-with-material-ui-pagination-is-disabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!