LoginSignup
0
0

More than 1 year has passed since last update.

#React でマテリアルUIをインストールして「ローディング中のぐるぐる」を使う

Last updated at Posted at 2020-03-17

package.json

dependencies に @material-ui/core を追加する

{
  "name": "example",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "react": "^16.13.0",
    "react-dom": "^16.13.0",
+    "@material-ui/core": "latest",
    "react-scripts": "3.4.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

App.js

ぐるぐるを三個置いてみる

import React from 'react';

import CircularProgress from '@material-ui/core/CircularProgress'

function App() {
  return (
    <div>
      <CircularProgress />
      <CircularProgress />
      <CircularProgress />
    </div>
  );
}

export default App;

画面例

yarn install
yarn start

して動作確認する

image

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0