2020-08-09 16:46:22 +03:00
|
|
|
import { hot } from 'react-hot-loader/root';
|
2018-12-22 17:20:04 +03:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Provider } from 'react-redux';
|
2020-09-10 18:45:02 +03:00
|
|
|
import { Store } from 'redux';
|
2018-12-22 17:20:04 +03:00
|
|
|
import TodoApp from './TodoApp';
|
|
|
|
import DevTools from './DevTools';
|
2020-09-10 18:45:02 +03:00
|
|
|
import { TodoState } from '../reducers';
|
|
|
|
import { TodoAction } from '../actions/TodoActions';
|
2018-12-22 17:20:04 +03:00
|
|
|
|
2020-09-10 18:45:02 +03:00
|
|
|
interface Props {
|
|
|
|
store: Store<TodoState, TodoAction>;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Root: React.FunctionComponent<Props> = ({ store }) => (
|
2018-12-22 17:20:04 +03:00
|
|
|
<Provider store={store}>
|
|
|
|
<div>
|
|
|
|
<TodoApp />
|
|
|
|
<DevTools />
|
|
|
|
</div>
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
|
|
|
|
Root.propTypes = {
|
2020-09-10 18:45:02 +03:00
|
|
|
store: PropTypes.any.isRequired,
|
2018-12-22 17:20:04 +03:00
|
|
|
};
|
|
|
|
|
2020-08-09 16:46:22 +03:00
|
|
|
export default hot(Root);
|