Ensure we always push into a BlockStatement - fixes T3051

This commit is contained in:
Logan Smyth
2015-12-02 19:29:49 -08:00
parent 53877ec158
commit d71b59d0cc
3 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,14 @@
function withContext(ComposedComponent) {
return class WithContext extends Component {
static propTypes = {
context: PropTypes.shape(
{
addCss: PropTypes.func,
setTitle: PropTypes.func,
setMeta: PropTypes.func,
}
),
};
};
}

View File

@@ -0,0 +1,20 @@
function withContext(ComposedComponent) {
var _class, _temp;
return _temp = _class = (function (_Component) {
babelHelpers.inherits(WithContext, _Component);
function WithContext() {
babelHelpers.classCallCheck(this, WithContext);
return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(WithContext).apply(this, arguments));
}
return WithContext;
})(Component), _class.propTypes = {
context: PropTypes.shape({
addCss: PropTypes.func,
setTitle: PropTypes.func,
setMeta: PropTypes.func
})
}, _temp;
}