UNPKG

@cc98/react-ubb-editor

Version:
13 lines (12 loc) 508 B
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 };