26 lines
No EOL
881 B
TypeScript
26 lines
No EOL
881 B
TypeScript
import React, { useRef, useState } from 'react';
|
|
import ReactDom from 'react-dom';
|
|
import {BrowserRouter, Route, Switch as RouterSwitch} from 'react-router-dom';
|
|
import { Gallery, ContentAbout} from './page/mod';
|
|
|
|
import './css/style.css';
|
|
|
|
const FooProfile = ()=><div>test profile</div>;
|
|
const App = () => {
|
|
return (<BrowserRouter>
|
|
<RouterSwitch>
|
|
<Route path="/" exact render={()=><Gallery />}></Route>
|
|
<Route path="/search" render={()=><Gallery />}></Route>
|
|
<Route path="/doc" render={(prop)=><ContentAbout {...prop}/>}></Route>
|
|
<Route path="/profile" component={FooProfile}></Route>
|
|
<Route>
|
|
<div>404 Not Found</div>
|
|
</Route>
|
|
</RouterSwitch>
|
|
</BrowserRouter>);
|
|
};
|
|
|
|
ReactDom.render(
|
|
<App/>,
|
|
document.getElementById("root")
|
|
) |