'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

class ConfigProvider extends _react.Component {
  getChildContext() {
    return {
      config: this.props.config
    };
  }

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

exports.default = ConfigProvider;
ConfigProvider.propTypes = {
  children: _propTypes2.default.node.isRequired,
  config: _propTypes2.default.object.isRequired
};

ConfigProvider.childContextTypes = {
  config: _propTypes2.default.object
};