leebenson / reactql

Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
https://reactql.org
MIT License
1.82k stars 173 forks source link

Adding Material UI Button cause emty page #171

Closed Fivedark closed 5 years ago

Fivedark commented 5 years ago

The Material UI Button or List crashes ReactQL. Other Material UI components like Card and Chip working fine.

Steps to reproduce:

  1. checkout current version 4.5.1
  2. run yarn add @material-ui/core
  3. add following lines to Example component at line 17: import {Button} from "@material-ui/core"; at line 48: <Button>Test</Button>
  4. run yarn start
  5. start your browser (newest Firefox or Chrome) and call localhost:3000

Expected result: To see a button under the headline.

Actual result: Empty page with a lot of warnings and errors in browser console. Last error is:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: null.

Check the render method of 'TransitionGroup'.
leebenson commented 5 years ago

According to https://material-ui.com/getting-started/usage/, the correct import is:

import Button from '@material-ui/core/Button';

Try that.

iweurman commented 4 years ago

Also have this issue for both import styles:

import Button from '@material-ui/core/Button';
import { Button } from '@material-ui/core';