Electron-react-boilerplate: How to use it with material-ui?

Created on 10 Jul 2019  路  3Comments  路  Source: electron-react-boilerplate/electron-react-boilerplate

I need to use material-ui.

I installed material-ui and then I try to use Button of material-ui. It doesn't work for me.

at /app/components/Home.js

// @flow
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Button from '@material-ui/core/Button'

import routes from '../constants/routes';
import styles from './Home.css';

type Props = {};

export default class Home extends Component<Props> {
  props: Props;

  render() {
    return (
      <div>
        <Button>TEST</Button>
        <h2>Home</h2>
        <Link to={routes.COUNTER}>to Counter</Link>
      </div>
    );
  }
}

it doesn't work. it has errors.
Screen Shot 2019-07-10 at 5 49 17 PM

Could you suggest to me?

enhancement

All 3 comments

I found that it doesn't work with material-ui above 4.0.0

it works with 3.9.1

I had the same issue. Downgrading worked for me, but would love for this boilerplate to support the latest version of material-ui/core

change the react-hot-loader version from 4.3.12 to the latest version in package.json, problem solved.

Was this page helpful?
0 / 5 - 0 ratings