@cc98/react-ubb-editor
Version:
A ubb editor component based on react
13 lines (12 loc) • 508 B
JavaScript
import { __assign } from "tslib";
import React from 'react';
import config from './config';
var context = React.createContext({
configs: config,
});
var Provider = context.Provider, Consumer = context.Consumer;
var withConfig = function (Component) { return function (props) { return (
// @ts-ignore
// FIXME: move to hooks
React.createElement(Consumer, null, function (config) { return React.createElement(Component, __assign({}, props, { config: config })); })); }; };
export { Provider, withConfig };