2
2

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.

create-react-appで作成したReactのバージョンを18から17に変更する

Posted at

内容

create-react-appで作成されたReactアプリケーションのバージョンが18となるので、17.0.2に変更する方法。

# create-react-appを使用してアプリケーションを作成
npx create-react-app my-app

目次

手順

package.json の下記を18から17に修正

"react": "^17.0.2",
"react-dom": "^17.0.2",

npm installを実行

npm install

index.js を下記ファイルに修正

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

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

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

以上

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?