https://stackoverflow.com/questions/71710596/warning-reactdom-render-is-no-longer-supported-in-react-18-use-createroot-ins

使用yarn启动的时候,yarn start提示: Warning:: ReactDOM.render is no longer supported in React 18. Use createRoot instead [duplicate]

解决,修改index.js为这样的格式(不推荐,可以尝试吧package.json的^的版本都修改为yarn .lock的准确的版本,^都删除)

import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
reportWebVitals();