DEV Community

Cover image for Migrate Material-UI 4 to Mui-5
HasOne
HasOne

Posted on β€’ Edited on

Migrate Material-UI 4 to Mui-5

Liquid syntax error: Variable '{{%20border:%20">codemod:
{% raw %}' was not properly terminated with regexp: /\}\}/

Top comments (16)

Collapse
Β 
damiisdandy profile image
damilola jerugba β€’

Nice, I personally don't like MUI, I love the fact that it has alot of components but visually it either looks too Google websity or generally unattractive. Plus it's so difficult to customize even after the new update

Collapse
Β 
eliasjnior profile image
Elias JΓΊnior β€’

I think the same as you, but as you can see in the homepage, it's possible to have a custom theme, that makes a lot of difference. Maybe in some time we will see some good open-source/paid themes.

Collapse
Β 
hasone profile image
HasOne β€’

I think we already some of paid theme availabe in the mui market, thanks!

Collapse
Β 
hasone profile image
HasOne β€’ β€’ Edited

@damiisdandy I totally agree with you. but It give us ability to use our own design, thanks!

Collapse
Β 
damiisdandy profile image
damilola jerugba β€’

Yes I’m it does, just wasn’t as streamlined

Collapse
Β 
hulyamasharipov profile image
Hulya β€’

Hi, thanks for writing this post. I'm getting an error like this when I try to run the project.`Child process failed to process the request: Error: Debug Failure. False expression.

Did you have any problem like that? I have found this error happened in typescript's older versions but I have updated the Typescript module. Do you think this is another bug?

Similar to this: stackoverflow.com/questions/508366...

Collapse
Β 
gtech1256 profile image
Roman β€’ β€’ Edited

If someone uses breakpoints in their theme for createTheme(), then I have a solution for how to get breakpoints

Material-UI 4

import createBreakpoints from '@material-ui/core/styles/createBreakpoints'

const breakpoints = createBreakpoints({})

export const defaultTheme = {...}
Enter fullscreen mode Exit fullscreen mode

Mui-5

yarn add @mui/system

import { createBreakpoints } from '@mui/system'

const breakpoints = createBreakpoints({})

export const defaultTheme = {...}
Enter fullscreen mode Exit fullscreen mode
Collapse
Β 
gisheri profile image
Eric Gish β€’

Thank you for adding this snippet. I was trying to figure this out!

Collapse
Β 
htorohn profile image
htorohn β€’

I have a questions, to run the codemods, do I have to run it file by file, or if run it on the src folder it will go recursively applying the changes on all files?

Collapse
Β 
hasone profile image
HasOne β€’

You can do both methods either on each file or src, components...

Collapse
Β 
abhishekdamborderfree profile image
abhishekdam-Borderfree β€’

can anyone tell me what is the script for codemod for just changing the muiv4 icons to muiv5 icons (just the icons and nothing)?

Collapse
Β 
kamalchoudhary profile image
Kamal Choudhary β€’ β€’ Edited

thank you so much for the very helpful tutorial. One question though, I recently upgraded Material UI from 4 to 5 and all of the Dialog components show at the end of the pages - they cause the page scroll all the way to the bottom and then they display - any clue how can I solve this - thanks!

Collapse
Β 
kamalchoudhary profile image
Kamal Choudhary β€’ β€’ Edited

Found that my Dialog components had "position: relative" in the MUI 4 implementation and they were being shown in the right place - but in MUI 5, they work fine without adding that CSS property.

Collapse
Β 
paras594 profile image
Paras πŸ§™β€β™‚οΈ β€’

Very well explained !!

Collapse
Β 
csemorf profile image
csemorf β€’

good

Collapse
Β 
jblengino510 profile image
Josh Blengino β€’

So clutch, thank you!