@@ -11,7 +11,7 @@ const THIRD_PARTY_ANIMATION_STYLES = 'THIRD_PARTY_ANIMATION_STYLES';
11
11
12
12
const ThirdPartyAnimationComponent = < V extends string | unknown > (
13
13
{ autoplay = true , loop = true , variant, ...props } : IThirdPartyAnimation < V > ,
14
- ref : React . ForwardedRef < HTMLDivElement | null >
14
+ ref : React . ForwardedRef < HTMLSpanElement | null >
15
15
) : JSX . Element => {
16
16
const [ animation , setAnimation ] = React . useState < AnimationItem > ( ) ;
17
17
const variantTheme = useStyles < { thirdPartyAnimationData : object } , V > (
@@ -20,15 +20,11 @@ const ThirdPartyAnimationComponent = <V extends string | unknown>(
20
20
) ;
21
21
22
22
const { thirdPartyAnimationData } = variantTheme ;
23
- const element = React . useRef < HTMLDivElement > ( null ) ;
23
+ const element = React . useRef < HTMLSpanElement > ( null ) ;
24
24
25
- React . useImperativeHandle (
26
- ref ,
27
- ( ) => {
28
- return element . current as HTMLDivElement ;
29
- } ,
30
- [ ]
31
- ) ;
25
+ React . useImperativeHandle ( ref , ( ) => {
26
+ return element . current as HTMLSpanElement ;
27
+ } , [ ] ) ;
32
28
33
29
React . useEffect ( ( ) => {
34
30
if ( element . current ) {
@@ -53,7 +49,7 @@ const ThirdPartyAnimationComponent = <V extends string | unknown>(
53
49
54
50
const ThirdPartyAnimation = React . forwardRef ( ThirdPartyAnimationComponent ) as < V > (
55
51
props : React . PropsWithChildren < IThirdPartyAnimation < V > > & {
56
- ref ?: React . ForwardedRef < HTMLDivElement | null > | undefined | null ;
52
+ ref ?: React . ForwardedRef < HTMLSpanElement | null > | undefined | null ;
57
53
}
58
54
) => ReturnType < typeof ThirdPartyAnimationComponent > ;
59
55
0 commit comments