mirror of
https://github.com/mgerb/react-starter
synced 2026-01-10 17:12:48 +00:00
convert to typescript - react-router upgrade to 4
This commit is contained in:
34
app/Wrapper.tsx
Normal file
34
app/Wrapper.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
||||
|
||||
import Navbar from './components/Navbar/Navbar';
|
||||
import Home from './pages/Home/Home';
|
||||
import NotFound from './pages/NotFound/NotFound';
|
||||
|
||||
//styling
|
||||
import './scss/index.scss';
|
||||
|
||||
interface Props {
|
||||
|
||||
}
|
||||
|
||||
interface State {
|
||||
|
||||
}
|
||||
|
||||
export default class Wrapper extends React.Component<Props, State> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<div>
|
||||
<Navbar/>
|
||||
<Switch>
|
||||
<Route exact path="/" component={Home}/>
|
||||
<Route component={NotFound}/>
|
||||
</Switch>
|
||||
</div>
|
||||
</BrowserRouter>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user