123456789101112131415161718192021222324252627282930 |
- import React from "react";
- import {connect} from "react-redux";
- import {bindActionCreators} from "redux";
- import Hello from "./../components/Hello";
- import * as actions from "./../actions";
- class App extends React.Component {
- constructor(props) {
- super(props);
- }
- render() {
- return (
- <Hello name={this.props.name} color={this.props.color} newName={this.props.newName} newBackground={this.props.newBackground} />
- );
- }
- }
- const mapStateToProps = state => {
- return {
- name: state.hello,
- color: state.color
- };
- };
- const mapDispatchToProps = dispatch => {
- return bindActionCreators(actions, dispatch);
- };
- export default connect(mapStateToProps, mapDispatchToProps)(App);
|