@appbuckets/react-ui-smart-components
Version:
UI Extended Components that work with @appbuckets/react-client and @appbuckets/react-ui
25 lines (22 loc) • 794 B
JavaScript
import { __rest } from '../_virtual/_tslib.js';
import * as React from 'react';
/** Create the base context */
var SmartComponentsContext = React.createContext(undefined);
/** Create the Hook */
var useSmartComponents = function () {
return React.useContext(SmartComponentsContext);
};
/** Export a Context Provider Shorthand */
var SmartComponentsProvider = function (props) {
/** Keep Props for Building Context Provider */
var children = props.children,
smartComponentProps = __rest(props, ['children']);
/** Return the Provider */
return React.createElement(
SmartComponentsContext.Provider,
{ value: smartComponentProps },
children
);
};
SmartComponentsProvider.displayName = 'SmartComponentsProvider';
export { SmartComponentsProvider, useSmartComponents };