UNPKG

@alicloud/console-components

Version:

Alibaba Cloud React Components

30 lines (29 loc) 1.18 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import React, { forwardRef } from 'react'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { Tab as FusionTab } from '@alifd/next'; import { ETheme } from '../../../enum'; import { useCssTheme } from '../../../hook'; import { hocWithThemeClass } from '../../../hoc'; function Tab0(props, ref) { var theme = useCssTheme(); var children = props.children; if (theme === ETheme.HYBRID || theme === ETheme.HYBRID_DARK) { return React.createElement(FusionTab, __assign({}, __assign({ animation: false }, props), { ref: ref }), children); } return React.createElement(FusionTab, __assign({}, props, { ref: ref }), children); } var TabWithRef = forwardRef(Tab0); var Tab = hocWithThemeClass(TabWithRef); hoistNonReactStatics(Tab, FusionTab); export default Tab;