feat: code split & use react helmet

This commit is contained in:
endiliey 2018-08-23 21:46:14 +08:00
parent bf1e30dc52
commit 406106b67e
19 changed files with 241 additions and 146 deletions

View file

@ -1,5 +1,5 @@
import React from 'react';
import TicTacToe from './tictactoe';
import Helmet from 'react-helmet';
import {Link} from 'react-router-dom';
export default class Home extends React.Component {
@ -12,10 +12,9 @@ export default class Home extends React.Component {
));
return (
<div>
<Helmet title="Homepage" />
<h2> Available Urls </h2>
<ul>{routeLinks}</ul>
<h2> Play some TicTacToe </h2>
<TicTacToe />
</div>
);
}

View file

@ -1,4 +1,5 @@
import React from 'react';
import Helmet from 'react-helmet';
import style from './tictactoe.css';
function Square(props) {
@ -125,6 +126,7 @@ class Game extends React.Component {
return (
<div className={style.game}>
<Helmet title="Tic Tac Toe" />
<div className={style.gameBoard}>
<Board squares={current.squares} onClick={i => this.handleClick(i)} />
</div>