UNPKG

@shopify/app-bridge-host

Version:

App Bridge Host contains components and middleware to be consumed by the app's host, as well as the host itself. The middleware and `Frame` component are responsible for facilitating communication between the client and host, and used to act on actions se

27 lines (24 loc) 780 B
import { __extends } from 'tslib'; import React from 'react'; import { appBridgeMiddlewareProptype } from './PropTypes.js'; var Provider = /** @class */ (function (_super) { __extends(Provider, _super); function Provider(props) { var _this = _super.call(this, props) || this; _this.middleware = props.middleware; return _this; } Provider.prototype.getChildContext = function () { return { appBridgeMiddleware: this.middleware, }; }; Provider.prototype.render = function () { return React.Children.only(this.props.children); }; Provider.childContextTypes = { appBridgeMiddleware: appBridgeMiddlewareProptype, }; return Provider; }(React.Component)); export { Provider };