Comments (5)
Adding this piece of code in the TablePagination component fixes this issue:
React.useEffect(() => {
const newLastPage = Math.max(0, Math.ceil(count / rowsPerPage) - 1);
if (page > newLastPage) {
onPageChange(null, newLastPage);
}
}, [count, page, rowsPerPage, onPageChange]);
However should this fix be implemented in the component itself? If so, I can open a pull request for this fix - however in my honest opinion it would pollute the component itself. What do you guys think?
from material-ui.
Thanks for your reply, I've tried this in the sandbox : https://codesandbox.io/p/sandbox/zealous-perlman-forked-9kskcl
But problem is the same, we come back to first page, but Mui error appears again
from material-ui.
Yep, this happens because of line 374 in the TablePagination.js
component.
I would propose to add the useEffect fix in the component itself (in the core component I mean) and remove this warning since that use case will be handled with the useEffect.
from material-ui.
You mean in the node_module folder ??? There isn't another solution ?
from material-ui.
You mean in the node_module folder ??? There isn't another solution ?
No no, I mean I meant to add this code in the core package so it gets fixed for you, but that was more of a question to the maintainers haha, sorry for the confusion.
from material-ui.
Related Issues (20)
- [docs] Demo VirtualElementPopover crashes HOT 1
- [material-ui][Accordion] First/Last of type styles do not work with other components as siblings HOT 2
- Add a Cascader component HOT 3
- [material-ui][Tooltip] Multiple tooltip sporadic repositioning with disablePortal and keepMounted true HOT 1
- [material-ui][Button] Text is not vertically centered HOT 1
- [system][Box] Add a `inset` prop for absolute positioning HOT 5
- [material-ui] Broken links in the All components page HOT 2
- [material-ui][Avatar Group] Spacing prop doesn't apply correct margin in RTL HOT 3
- [material-ui][docs] Component index icons should be blue, not purple HOT 3
- [material-ui] Linear progress is not working as expected for RTL HOT 1
- [base-ui][Tabs] Missing reference for RTL keyboard navigation direction
- [material-ui][Table] Add an export data button component HOT 1
- When render a component, added a class MuiSvgIcon HOT 1
- [material-ui][Bottom Navigation] Not showing up on the bottom of the page HOT 2
- When render a component, added a Style class in head MuiSvgIcon
- [base-ui][Popper] The `anchorEl` prop provided to the component is invalid
- Enhance the accessibility for colors on the default theme of JoyUI HOT 1
- [joy-ui][List Item Button] The `select` prop renders differently on different browsers and viewports
- [material-ui][Autocomplete] Label not refreshing on state change HOT 1
- [joy-ui][ModalDialog] Cannot add or remove layouts with styleOverrides to the ModalDialog
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-ui.