我想用 react-pdf 创建一个报告。使用 Image 时出现此错误。删除图像时没有错误。如何添加图像。谢谢您的帮助。
import React from "react";
import {styles} from "../styles";
import {Text, View,Image} from "@react-pdf/renderer";
export const HeaderBorder = () => (
<View style={{flexDirection: "row",border: "2 solid black",padding:"5px"}}>
<View
style={{
width: "40%"
}}
>
<Image
style={{
width: "100%",
height:"50px",
marginHorizontal: 0,
marginVertical: 0,
}}
src="./logo512"
/>
</View>
<View style={{width: "60%"}}>
<Text>Informations</Text>
</View>
</View>
)