UNPKG

@aliemir/react-live

Version:

A production-focused playground for live editing React code

17 lines (14 loc) 411 B
import React, { Component } from "react"; import LiveContext from "../components/Live/LiveContext"; export default function withLive(WrappedComponent, Context = LiveContext) { class WithLive extends Component { render() { return ( <Context.Consumer> {(live) => <WrappedComponent live={live} {...this.props} />} </Context.Consumer> ); } } return WithLive; }