mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
feat: code split & use react helmet
This commit is contained in:
parent
bf1e30dc52
commit
406106b67e
19 changed files with 241 additions and 146 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue