type: update unknown with SliderRef (#43094)

This commit is contained in:
lijianan 2023-06-19 17:07:09 +08:00 committed by GitHub
parent feb8c569e1
commit 33fab22b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
import type { SliderRef } from 'rc-slider/lib/Slider';
import raf from 'rc-util/lib/raf';
import { composeRef } from 'rc-util/lib/ref';
import * as React from 'react';
@ -5,7 +6,7 @@ import { useRef } from 'react';
import type { TooltipProps } from '../tooltip';
import Tooltip from '../tooltip';
const SliderTooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => {
const SliderTooltip = React.forwardRef<SliderRef, TooltipProps>((props, ref) => {
const { open } = props;
const innerRef = useRef<any>(null);
@ -36,4 +37,8 @@ const SliderTooltip = React.forwardRef<unknown, TooltipProps>((props, ref) => {
return <Tooltip ref={composeRef(innerRef, ref)} {...props} />;
});
if (process.env.NODE_ENV !== 'production') {
SliderTooltip.displayName = 'SliderTooltip';
}
export default SliderTooltip;