UNPKG

react-cent

Version:

React Component to make realtime apps with React simply. Provides integration with Centrifugo.

15 lines (11 loc) 330 B
import React, { Component } from 'react' import PropTypes from 'prop-types' const cent = (ComponentToWrap) => { return class extends Component { static contextTypes = { cent: PropTypes.object.isRequired } render = () => <ComponentToWrap {...this.props} cent={this.context.cent} /> } } export default cent