Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Material UI with Electron React Boilerplate?

Context

New electron user here. I just cloned and installed the recommended React + Electron repo: https://github.com/electron-react-boilerplate/electron-react-boilerplate

Now I want to use Material-UI. So I thought I just follow the instructions here:

https://material-ui.com/getting-started/installation/

After I did this, the app doesn't show me anything from Material-UI. I created a Component with a simple App Bar. But it does show nothing.

So I found out that there is another package.json in the folder /app/package.json I cd'd into it and redid the installation. Restart the dev server but still nothing shows up (no appbar, just white screen).

Here is a screenshot: enter image description here

Also according to the docs I should add a link for the roboto font to the html file. Where is this supposed to go? I put it into the only html file I found in app/app.html.

How can one set up Material-UI with Electron or rather this specific boilerplate?

I couldn't find anything up to date for this question.

like image 227
GeraltDieSocke Avatar asked Jan 21 '26 05:01

GeraltDieSocke


1 Answers

I found the error. Turns out I imported MenuIcon but material doesn't export it. So when I get rid of it, the appbar renders correctly.

like image 155
GeraltDieSocke Avatar answered Jan 22 '26 18:01

GeraltDieSocke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!