fix:修复类型提示错误

This commit is contained in:
zdl
2025-11-26 10:11:02 +08:00
parent b23ed93020
commit 581e874b0d
23 changed files with 587 additions and 1824 deletions

View File

@@ -1,17 +1,21 @@
import { useState } from "react";
import React, { useState } from 'react';
const Image = ({ className, ...props }) => {
const [loaded, setLoaded] = useState(false);
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
className?: string;
}
return (
<img
className={`inline-block align-top opacity-0 transition-opacity ${
loaded && "opacity-100"
} ${className}`}
onLoad={() => setLoaded(true)}
{...props}
/>
);
const Image: React.FC<ImageProps> = ({ className, ...props }) => {
const [loaded, setLoaded] = useState(false);
return (
<img
className={`inline-block align-top opacity-0 transition-opacity ${
loaded && 'opacity-100'
} ${className || ''}`}
onLoad={() => setLoaded(true)}
{...props}
/>
);
};
export default Image;