import { Component, Children } from 'react';
import PropTypes from 'prop-types';

class RouterProvider extends Component {
    constructor(props, context) {
        super(props, context);
        this.router = props.router;
    }

    getChildContext() {
        return { router: this.router };
    }

    componentWillReceiveProps(nextProps) {
        if (this.props.router !== nextProps.router) {
            console.error('[react-router5][Router]does not support changing the router object.');
        }
    }

    render() {
        const { children } = this.props;
        return Children.only(children);
    }
}

RouterProvider.propTypes = {
    router:   PropTypes.object.isRequired,
    children: PropTypes.element.isRequired
};

RouterProvider.childContextTypes = {
    router:   PropTypes.object.isRequired
};

export default RouterProvider;

@@ -441,17 +441,26 @@
 %5D%5BRouter
-%5D
+Provider%5D 
 does not

Fix error message in RouterProvider.js (#31)