将searchkit与material-ui进行反应(禁用分页) [英] react searchkit with material-ui (pagination is-disabled)

查看:64
本文介绍了将searchkit与material-ui进行反应(禁用分页)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在与material-ui一起使用的searchkit中遇到问题.这两个库都需要reactjs,但是版本不同.第一次,当我只使用带有响应的searchkit时,我的应用程序运行良好,没有错误和警告.然后我将material-ui连接到我的应用程序,并收到如下警告:

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警告:您正在为List上的insetSubheader道具手动调用React.PropTypes验证函数.不推荐使用此功能,在下一个主要版本中将不起作用.由于第三方PropTypes库,您可能会看到此警告.
  • warning.js:44警告:您正在为List上的subheader道具手动调用React.PropTypes验证函数.不推荐使用此功能,在下一个主要版本中将不起作用.由于第三方PropTypes库,您可能会看到此警告.
  • warning.js:44警告:您正在为List上的subheaderStyle道具手动调用React.PropTypes验证函数.不推荐使用此功能,在下一个主要版本中将不起作用.由于第三方PropTypes库,您可能会看到此警告.
  • warning.js:44警告:您正在为EnhancedButton上的linkButton道具手动调用React.PropTypes验证函数.不推荐使用此功能,在下一个主要版本中将不起作用.由于第三方PropTypes库,您可能会看到此警告.
  • 警告:标签上的未知道具labelColor.从元素中删除该道具. 在div中(由EnhancedButton创建) 在EnhancedButton中(由Chip创建) 芯片中(由JobTitleComponent创建) 在div中(由JobTitleComponent创建) 在div中(由CardText创建) 在CardText中(由JobTitleComponent创建) 在div中(由Card创建) 在div中(由Paper创建) 纸上(由卡创建) 在Card中(由JobTitleComponent创建) 在div中(由JobTitleComponent创建) 在div中(由JobTitleComponent创建) 在JobTitleComponent中(由DescriptionComponent创建) 在div中(由DescriptionComponent创建) 在div中(由DescriptionComponent创建) 在div中(由DescriptionComponent创建) 在MuiThemeProvider中(由DescriptionComponent创建) 在DescriptionComponent中(由FullDescription创建)
  • 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",
  • 反应":"15.3.0"
  • "react-dom":"15.3.0"
  • "searchkit":"^ 0.10.0".

然后,我将所有版本均更新为最新版本,searchkit分页消失了.我仍然可以在DOM中看到它,但是组件认为,只显示一页,并且具有已禁用"类,结果数量超过100,但是hitsPerPage = {10}. 我试图返回到以前的库版本,并且收到了相同的警告,但是分页功能仍然被禁用. 我该如何解决这个问题?请帮帮我.

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.

推荐答案

所以问题在于lodash的回归. 开发人员建议使用lodash@4.13.1,如果您使用的是webpack,请执行以下操作: resolve: { alias: { react: path.resolve('./node_modules/react'), lodash: path.resolve('./node_modules/lodash') } }

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.

这篇关于将searchkit与material-ui进行反应(禁用分页)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆