1.0.2 • Published 11 months ago
@samuelluo/markdown-img-ready v1.0.2
markdown-img-ready
用于检测 markdown 中图片加载是否完成
Usage
import Markdown from "react-markdown";
import { useImgReady } from "@samuelluo/markdown-img-ready";
export default () => {
const content = "";
const { ready, component: ImgComponent } = useImgReady(content);
return (
<Markdown
components={{
img: ImgComponent,
}}
>
{content}
</Markdown>
);
};