0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Reactメモ

Last updated at Posted at 2023-07-20

React17のインストールから起動まで

  1. npx create-react-app react-testでreactファイル作成
  2. dependenciesを下記に書き替える
    "@testing-library/jest-dom": "^5.16.2", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "react": "^17.0.2", "react-beautiful-dnd": "^13.1.0", "react-dom": "^17.0.2", "react-scripts": "5.0.0", "web-vitals": "^0.2.4"
  3. package-lock.jsonとnode_modulesを削除
  4. npm install で再インストール
  5. index.jsを下記に書き替える

import React from 'react';
import ReactDOM from 'react-dom';

const App = () => {
return (
<>
<.h1>こんにちは
>
);
}

ReactDOM.render(, document.getElementById("root"));

6.App.jsを下記のように書く

const App = () => {
return (
<>
<.h1>こんにちは</h1>
</>
);
}

ReactDOM.render(<App />, document.getElementById("root"));

7, npm start react-test で表示されたらOK

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?