I encountered an issue while trying to implement page pagination for my Table following a tutorial. The error message I see in my browser is:
Uncaught TypeError: Cannot read property 'main' of undefined
at ButtonRoot.ownerState.ownerState (Button.js:80)
at transformedStyleArg (createStyled.js:189)
at handleInterpolation (emotion-serialize.browser.esm.js:137)
at serializeStyles (emotion-serialize.browser.esm.js:262)
at emotion-styled-base.browser.esm.js:131
at emotion-element-cbed451f.browser.esm.js:36
at renderWithHooks (react-dom.development.js:14985)
at updateForwardRef (react-dom.development.js:17044)
at beginWork (react-dom.development.js:19098)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
This error is preventing me from displaying the page properly even though I have tried to handle style changes from mui v4 to mui v5 using simple CSS. The issue seems to be related to a "ButtonRoot." Here's the specific line causing the error:
backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),
Below is the code snippet where I am utilizing a "theme" (similar to what was shown in the tutorial):
import { useTheme } from '@mui/material';
import LastPageOutlinedIcon from "@mui/icons-material/LastPageOutlined";
import FirstPageIcon from "@mui/icons-material/FirstPage";
import KeyboardArrowLeftIcon from "@mui/icons-material/KeyboardArrowLeft";
import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
// Rest of the code...
Note: This excerpt represents only a portion of my code which may help identify the problem related to the "theme" style.
For reference, here is the link to the tutorial code I based my implementation on: https://codesandbox.io/s/ccw8hm?file=/demo.js