diff --git a/lib/index.js b/lib/index.js index b969c93..02edf32 100644 --- a/lib/index.js +++ b/lib/index.js @@ -136,34 +136,34 @@ ActionCableController.propTypes = { children: PropTypes.any } -var ActionCableConsumer = React.forwardRef(function (props, ref) { - var Component = createReactClass({ - render: function () { - return React.createElement(Consumer, null, ({ cable }) => { - return React.createElement( - ActionCableController, - { - cable, - ...this.props, - ref: this.props.forwardedRef - }, - this.props.children || null - ) - }) - } - }) +var Component = createReactClass({ + render: function () { + return React.createElement(Consumer, null, ({ cable }) => { + return React.createElement( + ActionCableController, + { + cable, + ...this.props, + ref: this.props.forwardedRef + }, + this.props.children || null + ) + }) + } +}); - Component.displayName = "ActionCableConsumer" +Component.displayName = "ActionCableConsumer" - Component.propTypes = { - onReceived: PropTypes.func, - onInitialized: PropTypes.func, - onConnected: PropTypes.func, - onDisconnected: PropTypes.func, - onRejected: PropTypes.func, - children: PropTypes.any - } +Component.propTypes = { + onReceived: PropTypes.func, + onInitialized: PropTypes.func, + onConnected: PropTypes.func, + onDisconnected: PropTypes.func, + onRejected: PropTypes.func, + children: PropTypes.any +} +var ActionCableConsumer = React.forwardRef(function (props, ref) { return React.createElement( Component, {