import React from 'react';
import { getDisplayName } from '../../getDisplayName';
export const withContext = (Context, parse) => (Component) => {
    const Wrapped = (props) => {
        const ctx = parse(props);
        return (React.createElement(Context.Provider, { value: ctx },
            React.createElement(Component, { ...props })));
    };
    Wrapped.displayName = `WithContext(${getDisplayName(Component)})`;
    return Wrapped;
};
//# sourceMappingURL=withContext.js.map