I have just contacted react, and introduced material-ui. I have been reporting errors all the time. Please give me some advice.

App.js introduces a subcomponent SnackbarExampleSimple

import React from "react";
import ReactDOM from "react-dom";
import SnackbarExampleSimple from "./Header"


  const App = () => (

    <div>
       {/* <Header/> */}
       <SnackbarExampleSimple/>
    </div>
   );
export default App;

the code in Header.js, is basically a copied official website instance

import React from "react";
// import ReactDOM from "react-dom";
// import "./css/header.css";

import Snackbar from "material-ui/Snackbar";
import RaisedButton from "material-ui/RaisedButton";

export default class SnackbarExampleSimple extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
      open: false,
    };
  }

  handleClick = () => {
    this.setState({
      open: true,
    });
  };

  handleRequestClose = () => {
    this.setState({
      open: false,
    });
  };

  render() {
    return (
      <div>
        <RaisedButton
          onClick={this.handleClick}
          label="Add to my calendar"
        />
        <Snackbar
          open={this.state.open}
          message="Event added to your calendar"
          autoHideDuration={4000}
          onRequestClose={this.handleRequestClose}
        />
      </div>
    );
  }
}

A bunch of wrong reports

Mar.12,2021

material-ui is it necessary to set the style during initialization?


the answer is in the comments


I'll use this again. This is because you didn't introduce css,
the correct way to introduce

.
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; //
import Toggle from 'material-ui/Toggle';

<MuiThemeProvider>
    <Toggle
        defaultToggled={mycheck}
        style={styles.toggle}
        trackSwitchedStyle={{backgroundColor:"-sharp4A8EF2"}}
        thumbStyle={styles.thumbStyle}
        thumbSwitchedStyle={styles.thumbStyle}
        onToggle={this.switchState}
        />
</MuiThemeProvider>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b320a9-2b634.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b320a9-2b634.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?