mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
refactor: remove React.FC for component package (#3575)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { lottieAtom } from '@affine/jotai';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import type { AnimationItem } from 'lottie-web';
|
||||
import type { FC } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
type CustomLottieProps = {
|
||||
interface CustomLottieProps {
|
||||
options: {
|
||||
loop?: boolean | number | undefined;
|
||||
autoReverse?: boolean | undefined;
|
||||
@@ -18,15 +17,15 @@ type CustomLottieProps = {
|
||||
speed?: number | undefined;
|
||||
width?: number | string | undefined;
|
||||
height?: number | string | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
export const InternalLottie: FC<CustomLottieProps> = ({
|
||||
export const InternalLottie = ({
|
||||
options,
|
||||
isStopped,
|
||||
speed,
|
||||
width,
|
||||
height,
|
||||
}) => {
|
||||
}: CustomLottieProps) => {
|
||||
const element = useRef<HTMLDivElement>(null);
|
||||
const lottieInstance = useRef<AnimationItem>();
|
||||
const lottie = useAtomValue(lottieAtom);
|
||||
|
||||
Reference in New Issue
Block a user