为什么当我在“Route”中声明“component”属性时会出现此错误;
类型“IntrinsicAttributes & (PathRouteProps | LayoutRouteProps | IndexRouteProps)”上不存在属性“组件”。
import { Routes, Route } from 'react-router-dom'
import './App.css'
import HomePage from './pages/HomePage'
function App() {
return(
<div>
<Routes>
<Route path="/" component={HomePage}/>
</Routes>
</div>
)
} ``` The problem might be; because I dont use 'exact path="/"' that might also give an error
Run Code Online (Sandbox Code Playgroud) react-router ×1