import * as React from 'react'; import createReactContext, { Context } from 'create-react-context'; export interface ConfigProviderProps { getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; } const ConfigContext: Context = createReactContext({}); const ConfigProvider: React.SFC = (props) => { const { getPopupContainer, children } = props; const config = { getPopupContainer, }; return ( {children} ); } export const ConfigConsumer = ConfigContext.Consumer; export default ConfigProvider;