Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am chrisbarthol on github.
* I am chrisbarthol (https://keybase.io/chrisbarthol) on keybase.
* I have a public key ASAQ29BmJLOevMADuZ9Rb-5zze4q7IzYEPsQyQDL4n8vzQo
To claim this, I am signing this object:
@ChrisBarthol
ChrisBarthol / App.js
Created January 27, 2017 16:14
React Tic Tac Toe - Add Other Routes
import React, { Component } from 'react'
import Header from './Header'
import Footer from './Footer'
class App extends Component {
render(){
return(
<div>
<Header />
<div className='content'>
@ChrisBarthol
ChrisBarthol / App.js
Created January 27, 2017 16:04
React Tic Tac Toe - Add React Router
import React, { Component } from 'react'
class App extends Component {
render(){
return <div>App</div>
}
}
export default App
@ChrisBarthol
ChrisBarthol / Board.js
Created January 4, 2017 19:12
Tic Tac Toe History
import React, { Component } from 'react'
import Square from './Square'
class Board extends Component {
renderSquare(i) {
return <Square value={this.props.squares[i]} onClick={() => this.props.onClick(i)} />;
}
render() {
@ChrisBarthol
ChrisBarthol / Board.js
Created January 4, 2017 15:48
Tic Tac Toe Declaring a Winner
import React, { Component } from 'react'
import Square from './Square'
class Board extends Component {
constructor(){
super()
this.state = {
squares: Array(9).fill(null),
xIsNext: true,
}
@ChrisBarthol
ChrisBarthol / Board.js
Created January 4, 2017 15:25
Tic Tac Toe Functional Component and Taking Turns
import React, { Component } from 'react'
import Square from './Square'
class Board extends Component {
constructor(){
super()
this.state = {
squares: Array(9).fill(null),
xIsNext: true,
}
@ChrisBarthol
ChrisBarthol / Board.js
Created January 4, 2017 15:21
Tic Tac Toe Higher State
import React, { Component } from 'react'
import Square from './Square'
class Board extends Component {
constructor(){
super()
this.state = {
squares: Array(9).fill(null),
}
}
@ChrisBarthol
ChrisBarthol / Square.js
Created January 4, 2017 15:01
Tic Tac Toe Clicking for X
import React, { Component } from 'react'
class Square extends Component {
constructor(props){
super(props)
this.clickFunction = this.clickFunction.bind(this)
this.state = {
value:null,
}
}
@ChrisBarthol
ChrisBarthol / Square1.js
Created January 4, 2017 14:57
Tic Tac Toe Passing This
import React, { Component } from 'react'
class Square extends Component {
clickFunction(){
alert('click')
}
render(){
return(