refactor: remove React.FC for component package (#3575)

This commit is contained in:
Garfield Lee
2023-08-04 23:00:28 +08:00
committed by GitHub
parent 7ec4b8fb8c
commit 65fc0ed59c
21 changed files with 165 additions and 149 deletions
@@ -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);