UNPKG

z-react-ui

Version:

z-react-ui,是一款基于 Dumi,由 React + TypeScript 开发的组件库 🎉。

26 lines (23 loc) 1.04 kB
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import classNames from 'classnames'; import { CSSTransition } from 'react-transition-group'; import { defaultPrefixCls } from '@/_utils/config'; export var animationPrefix = "".concat(defaultPrefixCls, "-animation"); var Transition = function Transition(_ref) { var children = _ref.children, className = _ref.className, _ref$animation = _ref.animation, animation = _ref$animation === void 0 ? 'top' : _ref$animation, restProps = _objectWithoutProperties(_ref, ["children", "className", "animation"]); return /*#__PURE__*/React.createElement(CSSTransition // @ts-ignore , Object.assign({ // @ts-ignore classNames: classNames(className ? className : "".concat(animationPrefix, "-").concat(animation)) }, restProps), /*#__PURE__*/React.createElement(React.Fragment, null, children)); }; Transition.defaultProps = { unmountOnExit: true, appear: true }; export default Transition;