更新到 React 18 或从 创建新的 React 18 应用程序后create-react-app,当我运行该yarn test命令时,它会为任何测试中使用的console.error每个方法发出警告,如下所示:render
console.error
警告:ReactDOM.render 在 React 18 中不再支持。请改用 createRoot。在您切换到新 API 之前,您的应用程序的行为就像运行 React 17 一样。了解更多信息:https ://reactjs.org/link/switch-to-createroot
由于 React 测试库目前似乎不支持 React 18 方法。
我正在使用Ubuntu。
\n我最近使用npm安装了firebase-tools,命令如下:
npm install -g firebase-tools\nRun Code Online (Sandbox Code Playgroud)\n后来也不知道,在我的项目中本地安装了另一个名为firebase的包。使用命令:
\nnpm install firebase\nRun Code Online (Sandbox Code Playgroud)\n此后我遇到了巨大的问题,不知道发生了什么。\n每当我运行任何 firebase 命令(例如:firebase --help、firebase login 等)时,它都会给我类似的输出,如下所示:
\n undefined\n undefined\n undefined\n ! H|H|H|H|H \n H__________________________________ H|\xc2\xa7|\xc2\xa7|\xc2\xa7|H H|* * * * * *|---------------------| H|\xc2\xa7|\xe2\x88\x9e|\xc2\xa7|H \n H| * * * * * |---------------------| H|\xc2\xa7|\xc2\xa7|\xc2\xa7|H H|* * * * * *|---------------------| H|H|H|H|H H| * * * * * |---------------------| H|H|H|H|H \nH|---------------------------------| =============== H|---------------------------------| /| _ _ | \n H|---------------------------------| (| O O |) H|---------------------------------| /| …Run Code Online (Sandbox Code Playgroud)