Node.js のインストール

VSCode

Javascriptの復習

変数宣言

Webフレームワークでは通常 const を使う

アロー関数

引数

テンプレート

null検査

モジュール


Create React App

npm start

$ cd my-react
$ npm start

Compiled successfully!

You can now view my-react in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://172.21.53.30:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

webpack compiled successfully

Webブラウザが localhost:3000 で起動される

react.png

停止は Ctrl+C

npm run build

配布物を作成する

$ npm run build

> my-react@0.1.0 build
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  46.66 kB  build/static/js/main.8a2e9294.js
  1.77 kB   build/static/js/787.c525e900.chunk.js
  513 B     build/static/css/main.f855e6bc.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

npm test

Unit Test を実行する

$ npm test

 PASS  src/App.test.js
  ✓ renders learn react link (8 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.128 s, estimated 1 s
Ran all test suites.

Watch Usage: Press w to show more.

npm run eject は実行しちゃダメ

React Dev Tool


HTML#React


添付ファイル: filereactDev4.png 134件 [詳細] filereactDev3.png 134件 [詳細] filereactDev2.png 137件 [詳細] filereactDev1.png 140件 [詳細] filebuild.png 150件 [詳細] filereact.png 150件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2024-01-10 (水) 00:06:33 (108d)
Short-URL: https://at-sushi.com:443/pukiwiki/index.php?cmd=s&k=45f6ec3c33
ISBN10
ISBN13
9784061426061