Created
October 23, 2016 05:38
-
-
Save tannerlinsley/3d62c17284a87b31f0b07f37f3423e9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { connect } from 'react-redux' | |
// | |
import CounterState from './state/counter' | |
// | |
import logo from './logo.svg' | |
import './App.css' | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h2>Welcome to React</h2> | |
</div> | |
<p className="App-intro"> | |
<h1>{ this.props.counter.count }</h1> | |
<button onClick={ () => CounterState.decrement() }>Decrement</button> | |
<button onClick={ () => CounterState.increment() }>Increment</button> | |
</p> | |
</div> | |
); | |
} | |
} | |
export default connect(state => { | |
return { | |
counter: state.counter | |
} | |
})(App) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment