[英]React / Material-ui pagination component works locally but not on the server
任何人都可以帮助解决我遇到的这个问题吗?
Uncaught TypeError: a is not a function at onClick (7f64add...e1.js:formatted:425)
当我点击链接 (7f64add...e1.js:formatted:425) 时,我得到了这个:
ActionsComponent: function(e) {
var t = e.count
, a = e.onChangePage;
return H("div", {
className: c.root
}, H(v.a, {
onClick: function(e) {
a(e, 0)
},
disabled: 0 === r,
"aria-label": "first page"
}, "rtl" === l.direction ? H(B.a, null) : H(T.a, null)), H(v.a, {
onClick: function(e) {
a(e, r - 1)
},
disabled: 0 === r,
"aria-label": "previous page"
}, "rtl" === l.direction ? H(A.a, null) : H(N.a, null)), H(v.a, {
onClick: function(e) {
a(e, r + 1)
},
disabled: r >= Math.ceil(t / o) - 1,
"aria-label": "next page"
}, "rtl" === l.direction ? H(N.a, null) : H(A.a, null)), H(v.a, {
onClick: function(e) {
a(e, Math.max(0, Math.ceil(t / o) - 1))
},
disabled: r >= Math.ceil(t / o) - 1,
"aria-label": "last page"
}, "rtl" === l.direction ? H(T.a, null) : H(B.a, null)))
},
突出显示这部分:
onClick: function(e) {
a(e, r + 1)
},
我在这里找到了解决这个问题的方法: https : //github.com/mui-org/material-ui/issues/27192
它在页面顶部进行了解释,如下所示:
虽然 prop 弃用旨在成为一个非破坏性的更改,但 TablePagination 中存在一个极端情况,即重命名 onChangePage 属性会破坏现有代码。 具体来说,将 TablePagination 与自定义 ActionsComponent 一起使用会被破坏,因为提供给自定义 ActionsComponent 的 prop 已从 onChangePage -> onPageChange 更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.