UNPKG

@alicloudfe/components

Version:

A react component library for aliyun

29 lines (28 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 { Tab as NextTab } from '@alifd/next'; import React from 'react'; import { withThemeClass } from '../utils/withThemeClass'; import hoistNonReactStatics from 'hoist-non-react-statics'; import { useCssVar } from '../utils/useCssVar'; var Tab = withThemeClass(React.forwardRef(function (props, ref) { var children = props.children; var theme = useCssVar('--alicloudfe-components-theme').trim(); if (theme === 'hybridcloud' || theme === "hybridcloud-dark") { return (React.createElement(NextTab, __assign({ animation: false }, props, { ref: ref }), children)); } return (React.createElement(NextTab, __assign({}, props, { ref: ref }), children)); })); hoistNonReactStatics(Tab, NextTab); // @ts-ignore Tab.displayName = NextTab.displayName; export default Tab;