score:2

try this:

  • remove all dependencies by deleting node-modules folder in your project.

  • open a new terminal and run 'npm install'.

(those two instructions above are optional)

  • since there has been a major change moving from mui v4 to v5, makestyles() is deprecated, so that you have to use styled() function instead, and import it from '@emotion/styled';

example:

import styled from '@emotion/styled';


const usestyles = styled(theme => ({
    root: {
        //your styling rules
    }
}))

take a look at the following link as well, thanks for @tesladelmar 's answer:

https://www.reddit.com/r/reactjs/comments/uabs6g/material_ui_react_18/

good luck!


Related Query

More Query from same tag