rgaidot/koa-react-boilerplate

View on GitHub
frontend/src/containers/RootContainer.js

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';

import routes from '../routes';

const RootContainer = ({ store }) => {
    const history = syncHistoryWithStore(browserHistory, store);

    return (
        <Provider {...{ store }}>
            <Router path="/" {...{ history }} routes={routes} />
        </Provider>
    );
};

RootContainer.propTypes = {
    store: PropTypes.shape({}).isRequired,
};

export default RootContainer;