I have simple application in Reactjs + type script. I'm trying to use the BrowserRouter from react-router-dom.
This is my code :
import * as React from "react"
import { Popular } from "./popular"
import { BrowserRouter as Router, Route } from "react-router-dom"
export interface AppProp {
}
export interface AppState {
}
export class App extends React.Component<AppProp , AppState > {
render() {
return (
<div className='container'>
<Router>
<Route path='/popular' component={Popular} />
</Router>
</div>
)
}
}
export default App
I'm geting the following errors:
ERROR in [at-loader] ./node_modules/@types/react-router-dom/index.d.ts:55:25 TS2314: Generic type 'Component' requires 2 type argument(s).
ERROR in [at-loader] ./src/components/app.tsx:25:18 TS2604: JSX element type 'Router' does not have any construct or call signatures.
I search at google but nothing help.
someone has an idea ?
BR Nadav
BrowserRouter- Jude Niroshan