mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-14 13:46:55 +03:00
1a4e509b4b
* Fix * Test * Changes * Run prettier * Remove single quote
34 lines
788 B
JavaScript
Executable File
34 lines
788 B
JavaScript
Executable File
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { connect } from 'react-redux';
|
|
import { bindActionCreators } from 'redux';
|
|
import Header from '../components/Header';
|
|
import MainSection from '../components/MainSection';
|
|
import * as TodoActions from '../actions/TodoActions';
|
|
|
|
const TodoApp = ({ todos, actions }) => (
|
|
<div>
|
|
<Header addTodo={actions.addTodo} />
|
|
<MainSection todos={todos} actions={actions} />
|
|
</div>
|
|
);
|
|
|
|
TodoApp.propTypes = {
|
|
todos: PropTypes.array.isRequired,
|
|
actions: PropTypes.object.isRequired
|
|
};
|
|
|
|
function mapState(state) {
|
|
return {
|
|
todos: state.todos
|
|
};
|
|
}
|
|
|
|
function mapDispatch(dispatch) {
|
|
return {
|
|
actions: bindActionCreators(TodoActions, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(mapState, mapDispatch)(TodoApp);
|