React の環境構築を create-react-appで実施すると現在(2022年6月 時点)React 18 がインストールされます。
現在、npm install でインストールする Ignite UI for React のパッケージと互換性があるReact バージョンは 16.9.0 となっているため、React のバージョンを更新する必要があります。
(参考:サポート環境)
以下の手順で更新を行ってください。
- package.json の下記を18.x.xから16.9.0に修正
- “react”: “^18.x.x”,
- “react-dom”: “^18.x.x”,
- npm install を実行
- index.js(index.tsx) を下記に修正
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();