How to apply withStyles material-ui in IE9?

575 Views Asked by At

I should apply material-ui in IE 9 (I hate to do... ) It works fine in Chrome and IE 11 but I got some errors which is look like from withStyles. Is anyone success to solve the problem?

Working on react 16

  1. Installed some of babel-loader and polyfill

In packages.json

@material-ui/core": "^3.9.3

@material-ui/icons": "^3.0.2

babel-polyfill": "^6.26.0

es6-promise": "^4.2.6

fetch-ie8": "^1.5.0
  1. Included CDN in public/index.html

=> cdn.polyfill.io/v3/polyfill.js

  1. Imported these

es6-object-assign/auto

es6-promise/auto

import React, {Component} from 'react';
import { withStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';

const styles = (theme) => ({
    test : {
        color: 'red'
    }
})

class Login extends Component{
    render(){

        const {classes} = this.props;

        return(
            <div>
                <AppBar>test</AppBar>
            </div>
        )
    }
}

export default withStyles(styles)(Login);

Chrome, IE11 works fine but IE10, IE9 brings error with blank page

0

There are 0 best solutions below