Utilisation de React pour le client
This commit is contained in:
24
client/src/components/App.jsx
Normal file
24
client/src/components/App.jsx
Normal file
@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import { HashRouter as Router, Route, Redirect, Switch } from "react-router-dom";
|
||||
import { store } from '../store/store';
|
||||
import { Provider } from 'react-redux';
|
||||
import { HomePage } from './HomePage/HomePage';
|
||||
import { BoardPage } from './BoardPage/BoardPage';
|
||||
|
||||
export class App extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<React.Fragment>
|
||||
<Router>
|
||||
<Switch>
|
||||
<Route path="/" exact component={HomePage} />
|
||||
<Route path="/board/:id" exact component={BoardPage} />
|
||||
<Route component={() => <Redirect to="/" />} />
|
||||
</Switch>
|
||||
</Router>
|
||||
</React.Fragment>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user