You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
698 B
33 lines
698 B
'use strict'; |
|
|
|
import React, {Component} from 'react'; |
|
import {bindActionCreators} from 'redux'; |
|
import Counter from '../components/counter'; |
|
import * as counterActions from '../actions/counterActions'; |
|
import { connect } from 'react-redux'; |
|
|
|
// @connect(state => ({ |
|
// state: state.counter |
|
// })) |
|
class CounterApp extends Component { |
|
constructor(props) { |
|
super(props); |
|
} |
|
|
|
render() { |
|
const { state, actions } = this.props; |
|
return ( |
|
<Counter |
|
counter={state.count} |
|
{...actions} /> |
|
); |
|
} |
|
} |
|
|
|
export default connect(state => ({ |
|
state: state.counter |
|
}), |
|
(dispatch) => ({ |
|
actions: bindActionCreators(counterActions, dispatch) |
|
}) |
|
)(CounterApp);
|
|
|