diff --git a/src/UniqueProvider/MotionContent.tsx b/src/UniqueProvider/MotionContent.tsx deleted file mode 100644 index fba5f549..00000000 --- a/src/UniqueProvider/MotionContent.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react'; -import type { TriggerProps } from '..'; -import CSSMotion from '@rc-component/motion'; -import classNames from 'classnames'; - -export interface MotionContentProps { - prefixCls: string; // ${prefixCls}-motion-content apply on root div - children: TriggerProps['popup']; -} - -const MotionContent = (props: MotionContentProps) => { - const { prefixCls, children } = props; - - const childNode = typeof children === 'function' ? children() : children; - - // motion name: `${prefixCls}-motion-content-fade`, apply in index.less - const motionName = `${prefixCls}-motion-content-fade`; - - return ( - - {({ className: motionClassName, style: motionStyle }) => { - const cls = classNames(`${prefixCls}-motion-content`, motionClassName); - - return ( -
- {childNode} -
- ); - }} -
- ); -}; - -if (process.env.NODE_ENV !== 'production') { - MotionContent.displayName = 'MotionContent'; -} - -export default MotionContent; diff --git a/src/UniqueProvider/index.tsx b/src/UniqueProvider/index.tsx index f1fbe68d..74b2057b 100644 --- a/src/UniqueProvider/index.tsx +++ b/src/UniqueProvider/index.tsx @@ -14,7 +14,6 @@ import useTargetState from './useTargetState'; import { isDOM } from '@rc-component/util/lib/Dom/findDOMNode'; import FloatBg from './FloatBg'; import classNames from 'classnames'; -import MotionContent from './MotionContent'; import { getAlignPopupClassName } from '../util'; export interface UniqueProviderProps { @@ -43,8 +42,6 @@ const UniqueProvider = ({ children }: UniqueProviderProps) => { }); // ========================== Register ========================== - const [popupId, setPopupId] = React.useState(0); - // Store the isOpen function from the latest show call const isOpenRef = React.useRef<(() => boolean) | null>(null); @@ -56,9 +53,6 @@ const UniqueProvider = ({ children }: UniqueProviderProps) => { isOpenRef.current = isOpen; delayInvoke(() => { - if (showOptions.id !== options?.id) { - setPopupId((i) => i + 1); - } trigger(showOptions); }, showOptions.delay); }, @@ -172,11 +166,7 @@ const UniqueProvider = ({ children }: UniqueProviderProps) => { ref={setPopupRef} portal={Portal} prefixCls={prefixCls} - popup={ - - {options.popup} - - } + popup={options.popup} className={classNames( options.popupClassName, alignedClassName,