@shopgate/engage
Version:
Shopgate's ENGAGE library.
28 lines (27 loc) • 617 B
JavaScript
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { jsx as _jsx } from "react/jsx-runtime";
const Context = /*#__PURE__*/React.createContext(null);
/**
* Tab Context Provider
* @param {Object} props props
* @returns {JSX}
*/
const TabContext = props => {
const {
children,
value
} = props;
const context = React.useMemo(() => ({
value
}), [value]);
return /*#__PURE__*/_jsx(Context.Provider, {
value: context,
children: children
});
};
/**
* @returns {unknown}
*/
export const useTabContext = () => React.useContext(Context);
export { TabContext };