stub react pages structure
This commit is contained in:
parent
7e2156ff06
commit
a4546a8ef5
1 changed files with 13 additions and 0 deletions
13
src/App.js
13
src/App.js
|
@ -2,6 +2,8 @@ import React, {useState} from 'react';
|
||||||
import './App.scss';
|
import './App.scss';
|
||||||
import config from './config';
|
import config from './config';
|
||||||
|
|
||||||
|
import { Switch, Route } from 'react-router-dom';
|
||||||
|
|
||||||
import socketIOClient from 'socket.io-client';
|
import socketIOClient from 'socket.io-client';
|
||||||
export const socket = socketIOClient(config.apiAddress);
|
export const socket = socketIOClient(config.apiAddress);
|
||||||
|
|
||||||
|
@ -16,6 +18,17 @@ function App() {
|
||||||
<h1>React Boilerplate</h1>
|
<h1>React Boilerplate</h1>
|
||||||
{fetchData ? <p>{fetchData}</p> : <></>}
|
{fetchData ? <p>{fetchData}</p> : <></>}
|
||||||
{socketData ? <p>{socketData}</p> : <></>}
|
{socketData ? <p>{socketData}</p> : <></>}
|
||||||
|
<Switch>
|
||||||
|
|
||||||
|
<Route path="/" exact>
|
||||||
|
<p>Index</p>
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
<Route path="/game">
|
||||||
|
<p>Game</p>
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue