Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80517 views
1
'use strict';
2
3
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; };
4
5
module.exports = addContext;
6
7
var _React = require('react');
8
9
var React = _interopRequire(_React);
10
11
function addContext(Component, context, contextTypes) {
12
return React.createClass({
13
childContextTypes: contextTypes,
14
15
getChildContext: function getChildContext() {
16
return context;
17
},
18
19
render: function render() {
20
return React.createElement(Component, this.props);
21
}
22
});
23
}
24