使用react-router-dom版本6时出现以下错误:
\nUncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nRun Code Online (Sandbox Code Playgroud)\n据说我的BrowserRouter是问题,这似乎表明 React 和渲染器不匹配。但是,我找不到任何问题。下面是导致错误的代码片段:
\nimport React from 'react';\nimport './App.css';\nimport { BrowserRouter, Route, …Run Code Online (Sandbox Code Playgroud)