Matched leaf route at location “/” does not have an element. This means it will render an with a null value by default resulting in an “empty” page.
高版本中Switch已经被换成了Routes
错误代码:
<Route path="/" exact={false} component={<div>home</div>} />
正确代码
<Route path="/" exact={false} element={<div>home</div>} />