LoginSignup
0
0

More than 1 year has passed since last update.

MUIのクイックスタートを実装する(React Material Component)

Posted at

はじめに

MUIとはMaterialUIで作成されたコンポーネント。
スクリーンショット 2022-05-17 22.16.32.png

QuickStart

~/develop/react $ npx create-react-app material_quickstart --template typescript

Creating a new React app in /Users/kawamurakouji/develop/react/material_quickstart.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...


added 1379 packages in 1m

181 packages are looking for funding
  run `npm fund` for details

Initialized a git repository.

Installing template dependencies using npm...
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated

added 39 packages, and changed 1 package in 5s

181 packages are looking for funding
  run `npm fund` for details

We detected TypeScript in your project (src/App.test.tsx) and created a tsconfig.json file for you.

Your tsconfig.json has been populated with default values.

Removing template package using npm...


removed 1 package, and audited 1418 packages in 2s

181 packages are looking for funding
  run `npm fund` for details

6 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Created git commit.

Success! Created material_quickstart at /Users/kawamurakouji/develop/react/material_quickstart
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd material_quickstart
  npm start

Happy hacking!
App.tsx
import * as React from 'react';
import ReactDOM from 'react-dom';
import Button from '@mui/material/Button';

function App() {
  return <Button variant="contained">Hello World</Button>;
}

■実行結果
スクリーンショット 2022-05-17 22.25.18.png

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