I am making a multi step form for which I was using Material UI component. But the moment I import it, it shows error. The code is:
import React from 'react';
import { ThemeProvider } from '@mui/material/styles';
import AppBar from '@mui/material/AppBar';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
function FormUserDetails({ nextstep, values }) {
const proceed = (e) => {
e.preventDefault();
nextstep();
}
return (
<ThemeProvider>
<React.Fragment>
<AppBar position="static">
<Toolbar>
<Typography variant="h6" component="div" sx={{ flexGrow: 1 }}>
News
</Typography>
</Toolbar>
</AppBar>
</React.Fragment>
</ThemeProvider>
)
}
export default FormUserDetails
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>
Now the error looks like this: `
TypeError: Cannot read properties of undefined (reading '100') (anonymous function) C:/Users/edkni/Documents/projects/multi-step form/state_form/node_modules/@mui/material/AppBar/AppBar.js:40
37 | theme,
38 | ownerState 39 | }) => { 40 | const backgroundColorDefault = theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[900]; 41 | return _extends({ 42 | display: 'flex', 43 | flexDirection: 'column',View compiled transformedStyleArg C:/Users/edkni/Documents/projects/multi-step form/state_form/node_modules/@mui/system/esm/createStyled.js:175 172 | } = _ref2, 173 | other = _objectWithoutPropertiesLoose(_ref2, _excluded3); 174 | 175 | return styleArg(_extends({ 176 | theme: isEmpty(themeInput) ? defaultTheme : themeInput 177 | }, other)); 178 | };
I have no idea what that means. It would be great help if someone could answer. Thank you in advance.
CodePudding user response: